catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Expanded the practical example in slow-compiles documentation
- Commit
26f6012bb92f012d972efe6ab6ecda6f8c8191b7- Author
- Martin Hořeňovský ·
- Parents
50dee9ae5733
Changes
docs/slow-compiles.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/slow-compiles.md b/docs/slow-compiles.md index efb3d6b5..1217f9f8 100644 --- a/docs/slow-compiles.md +++ b/docs/slow-compiles.md @@ -42,6 +42,21 @@ TEST_CASE( "Factorials are computed", "[factorial]" ) { After compiling `tests-main.cpp` once, it is enough to link it with separately compiled `tests-factorial.cpp`. This means that adding more tests to `tests-factorial.cpp`, will not result in recompiling Catch's main and the resulting compilation times will decrease substantially. +``` +$ g++ tests-main.cpp -c +$ g++ tests-main.o tests-factorial.cpp -o tests && ./tests -r compact +Passed 1 test case with 4 assertions. +``` + +Now, the next time we change the file `tests-factorial.cpp` (say we add `REQUIRE( Factorial(0) == 1)`), it is enough to recompile the tests instead of recompiling main as well: + +``` +$ g++ tests-main.o tests-factorial.cpp -o tests +$ g++ tests-main.o tests-factorial.cpp -o tests && ./tests -r compact +tests-factorial.cpp:11: failed: Factorial(0) == 1 for: 0 == 1 +Failed 1 test case, failed 1 assertion. +``` + ---