mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 11:43:29 +01:00
Add build instructions to contributing.md
This commit is contained in:
parent
c1720d0c42
commit
bc02ada4b0
@ -37,20 +37,41 @@ as these are managed by the scripts!__
|
|||||||
|
|
||||||
## Testing your changes
|
## Testing your changes
|
||||||
|
|
||||||
Obviously all changes to Catch's code should be tested. If you added new functionality, you should add tests covering and
|
Obviously all changes to Catch's code should be tested. If you added new
|
||||||
showcasing it. Even if you have only made changes to Catch internals (ie you implemented some performance improvements),
|
functionality, you should add tests covering and showcasing it. Even if you have
|
||||||
you should still test your changes.
|
only made changes to Catch internals (i.e. you implemented some performance
|
||||||
|
improvements), you should still test your changes.
|
||||||
|
|
||||||
This means 3 things
|
This means 3 things
|
||||||
|
|
||||||
* Compiling Catch's SelfTest project -- code that does not compile is evidently incorrect. Obviously, you are not expected to
|
* Compiling Catch's SelfTest project:
|
||||||
have access to all compilers and platforms Catch supports, Catch's CI pipeline will compile your code using supported compilers
|
```
|
||||||
once you open a PR.
|
$ cd Catch2
|
||||||
* Running the SelfTest binary. There should be no unexpected failures on simple run.
|
$ cmake -Bcmake-build-debug -H. -DCATCH_BUILD_TESTING=ON
|
||||||
* Running Catch's approval tests. Approval tests compare current output of the SelfTest binary in various configurations against
|
$ cd cmake-build-debug/
|
||||||
known good output. Catch's repository provides utility scripts `approvalTests.py` to help you with this. It needs to be passed
|
$ make
|
||||||
the SelfTest binary compiled with your changes, like so: `$ ./scripts/approvalTests.py clang-build/SelfTest`. The output should
|
```
|
||||||
be fairly self-explanatory.
|
-- code that does not compile is evidently incorrect. Obviously, you are not
|
||||||
|
expected to have access to all compilers and platforms Catch supports, Catch's
|
||||||
|
CI pipeline will compile your code using supported compilers once you open a PR.
|
||||||
|
|
||||||
|
* Running the SelfTest binary:
|
||||||
|
```
|
||||||
|
$ ./cmake-build-debug/projects/SelfTest
|
||||||
|
```
|
||||||
|
There should be no unexpected failures on simple run.
|
||||||
|
*Note: on Windows, the binary is located at `cmake-build-debug\projects\Debug\SelfTest`*
|
||||||
|
|
||||||
|
* Running Catch's approval tests:
|
||||||
|
```
|
||||||
|
$ ./scripts/approvalTests.py
|
||||||
|
```
|
||||||
|
Approval tests compare current output of the SelfTest binary in various
|
||||||
|
configurations against known good output. If you've configured the SelfTest
|
||||||
|
binary with your changes to be located in any other directory than
|
||||||
|
`/cmake-build-debug/projects/SelfTest`, its path needs to be passed to the
|
||||||
|
script, like so: `$ ./scripts/approvalTests.py clang-build/SelfTest`.
|
||||||
|
The output should be fairly self-explanatory.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user