mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 05:16:10 +01:00
Embed the script buildAndTest.sh inside the docs
This commit is contained in:
parent
4035beb988
commit
c6352c3e1f
@ -78,23 +78,30 @@ the invocation of CMake configuration step.
|
|||||||
Bringing this all together, the steps below should configure, build,
|
Bringing this all together, the steps below should configure, build,
|
||||||
and run all tests in the `Debug` compilation.
|
and run all tests in the `Debug` compilation.
|
||||||
|
|
||||||
1. Regenerate the amalgamated distribution
|
<!-- snippet: catch2-build-and-test -->
|
||||||
|
<a id='snippet-catch2-build-and-test'></a>
|
||||||
|
```sh
|
||||||
|
# 1. Regenerate the amalgamated distribution
|
||||||
|
./tools/scripts/generateAmalgamatedFiles.py
|
||||||
|
|
||||||
|
# 2. Configure the full test build
|
||||||
|
cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON
|
||||||
|
|
||||||
|
# 3. Run the actual build
|
||||||
|
cmake --build debug-build
|
||||||
|
|
||||||
|
# 4. Run the tests using CTest
|
||||||
|
cd debug-build
|
||||||
|
ctest -j 4 --output-on-failure -C Debug
|
||||||
```
|
```
|
||||||
$ cd Catch2
|
<sup><a href='/tools/scripts/buildAndTest.sh#L6-L19' title='File snippet `catch2-build-and-test` was extracted from'>snippet source</a> | <a href='#snippet-catch2-build-and-test' title='Navigate to start of snippet `catch2-build-and-test`'>anchor</a></sup>
|
||||||
$ ./tools/scripts/generateAmalgamatedFiles.py
|
<!-- endSnippet -->
|
||||||
```
|
|
||||||
2. Configure the full test build
|
For convenience, the above commands are in the script `tools/scripts/buildAndTest.sh`, and can be run like this:
|
||||||
```
|
|
||||||
$ cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON
|
```bash
|
||||||
```
|
cd Catch2
|
||||||
3. Run the actual build
|
./tools/scripts/buildAndTest.sh
|
||||||
```
|
|
||||||
$ cmake --build debug-build
|
|
||||||
```
|
|
||||||
4. Run the tests using CTest
|
|
||||||
```
|
|
||||||
$ cd debug-build
|
|
||||||
$ ctest -j 4 --output-on-failure -C Debug
|
|
||||||
```
|
```
|
||||||
|
|
||||||
If you added new tests, you will likely see `ApprovalTests` failure.
|
If you added new tests, you will likely see `ApprovalTests` failure.
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
# Start at the root of the Catch project directory, for example:
|
# Start at the root of the Catch project directory, for example:
|
||||||
# cd Catch2
|
# cd Catch2
|
||||||
|
|
||||||
|
# begin-snippet: catch2-build-and-test
|
||||||
# 1. Regenerate the amalgamated distribution
|
# 1. Regenerate the amalgamated distribution
|
||||||
./tools/scripts/generateAmalgamatedFiles.py
|
./tools/scripts/generateAmalgamatedFiles.py
|
||||||
|
|
||||||
@ -15,3 +16,4 @@ cmake --build debug-build
|
|||||||
# 4. Run the tests using CTest
|
# 4. Run the tests using CTest
|
||||||
cd debug-build
|
cd debug-build
|
||||||
ctest -j 4 --output-on-failure -C Debug
|
ctest -j 4 --output-on-failure -C Debug
|
||||||
|
# end-snippet
|
||||||
|
Loading…
Reference in New Issue
Block a user