Skip to content

Commit 43a28ca

Browse files
authored
Fix CTest command for older CMake (#95)
1 parent f5e1281 commit 43a28ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lectures/googletest.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,12 @@ Now with these tests defined and our CMake configured to discover them, we can e
218218
219219
<!-- B-roll building and executing -->
220220
We now just need to build the project again and run `ctest`:
221-
```cmd
221+
```bash
222222
cmake -S . -B build
223223
cmake --build build -j 12
224224
GTEST_COLOR=1 ctest --test-dir build --output-on-failure -j12
225+
# Or if you have an older CMake version (<3.20)
226+
cd build && GTEST_COLOR=1 ctest --output-on-failure -j12
225227
```
226228

227229
<!-- Talking head with error overlay -->
@@ -234,7 +236,7 @@ We can easily fix this error by changing the code in our test.
234236
-ASSERT_EQ(GetMeaningOfLife(), 0) << "Oh no, a mistake!";
235237
+ASSERT_EQ(GetMeaningOfLife(), 42) << "Oh no, a mistake!";
236238
```
237-
We now execute this again and see that all the tests have passed! Hooray! **(cheerful video)**
239+
We now execute this again and see that all the tests have passed! Hooray!
238240

239241
### Testing our own libraries
240242
<!-- Talking head -->

0 commit comments

Comments
 (0)