Skip to content

Commit 8d3ad7e

Browse files
authored
Merge pull request #551 from JunaidAhamed-7777/docs/ctest-build-directory
Document how to run the unit tests with CTest
2 parents 00ae413 + 93aa1de commit 8d3ad7e

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

‎Documents/Getting-Started.md‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,27 @@ The AMWA NMOS API Testing Tool may be used to test the REST APIs and behaviour o
133133

134134
### Unit tests
135135

136-
The unit tests are currently packaged into a single test suite, as the **nmos-cpp-test** application.
137-
This may be run automatically by building RUN_TESTS, but note that to see the output of any failed tests,
138-
it is necessary to set ``CTEST_OUTPUT_ON_FAILURE`` to ``1`` in the environment first.
136+
When you build this repository with ``NMOS_CPP_BUILD_TESTS`` enabled (the default), CMake builds
137+
the **nmos-cpp-test** application and registers its tests with CTest. CTest does not rebuild
138+
**nmos-cpp-test**, so build the project before running the tests.
139139

140-
The build output should conclude something like this:
140+
From your CMake build directory, run:
141+
142+
```sh
143+
ctest --output-on-failure
144+
```
145+
146+
If you used a multi-configuration generator such as Visual Studio, specify the configuration you built:
147+
148+
```sh
149+
ctest -C Release --output-on-failure
150+
```
151+
152+
Replace ``Release`` with ``Debug`` if you built the Debug configuration.
153+
In the Visual Studio IDE, building the **RUN_TESTS** target runs the same tests; set ``CTEST_OUTPUT_ON_FAILURE``
154+
to ``1`` in the environment first to see the output of any failed tests.
155+
156+
CTest prints the output of any failing tests and ends with a summary like this:
141157

142158
```
143159
100% tests passed, 0 tests failed out of 52

0 commit comments

Comments
 (0)