| 1 | #!/usr/bin/env sh |
| 2 | |
| 3 | # Start at the root of the Catch project directory, for example: |
| 4 | # cd Catch2 |
| 5 | |
| 6 | # begin-snippet: catch2-build-and-test |
| 7 | # 1. Regenerate the amalgamated distribution |
| 8 | ./tools/scripts/generateAmalgamatedFiles.py |
| 9 | |
| 10 | # 2. Configure the full test build |
| 11 | cmake -B debug-build -S . -DCMAKE_BUILD_TYPE=Debug --preset all-tests |
| 12 | |
| 13 | # 3. Run the actual build |
| 14 | cmake --build debug-build |
| 15 | |
| 16 | # 4. Run the tests using CTest |
| 17 | cd debug-build |
| 18 | ctest -j 4 --output-on-failure -C Debug |
| 19 | # end-snippet |