Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/README.md
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | With valgrind, you might need to increase the max stack size: | ||||
$ valgrind --max-stackframe=2500000 ./exhaustive_tests | $ valgrind --max-stackframe=2500000 ./exhaustive_tests | ||||
Test coverage | Test coverage | ||||
----------- | ----------- | ||||
This library aims to have full coverage of the reachable lines and branches. | This library aims to have full coverage of the reachable lines and branches. | ||||
To create a test coverage report, configure with `--enable-coverage` (use of GCC is necessary): | __To create a test coverage report with autotools:__ | ||||
Configure with `--enable-coverage` (use of GCC is necessary): | |||||
$ ./configure --enable-coverage | $ ./configure --enable-coverage | ||||
Run the tests: | Run the tests: | ||||
$ make check | $ make check | ||||
To create a report, `gcovr` is recommended, as it includes branch coverage reporting: | To create a report, `gcovr` is recommended, as it includes branch coverage reporting: | ||||
$ gcovr --exclude 'src/bench*' --print-summary | $ gcovr --exclude 'src/bench*' --print-summary | ||||
To create a HTML report with coloured and annotated source code: | To create a HTML report with coloured and annotated source code: | ||||
$ gcovr --exclude 'src/bench*' --html --html-details -o coverage.html | $ gcovr --exclude 'src/bench*' --html --html-details -o coverage.html | ||||
__To create a test coverage report with CMake:__ | |||||
Make sure you installed the dependencies first, and they are in your `PATH`: | |||||
`c++filt`, `gcov`, `genhtml`, `lcov` and `python3`. | |||||
Then run the build, tests and generate the coverage report with: | |||||
```bash | |||||
mkdir coverage | |||||
cd coverage | |||||
cmake -GNinja .. \ | |||||
-DCMAKE_C_COMPILER=gcc \ | |||||
-DSECP256K1_ENABLE_BRANCH_COVERAGE=ON \ | |||||
-DSECP256K1_ENABLE_BRANCH_COVERAGE=ON # optional | |||||
ninja coverage-check-secp256k1 | |||||
``` | |||||
The coverage report will be available by opening the file | |||||
`check-secp256k1.coverage/index.html` with a web browser. | |||||
Reporting a vulnerability | Reporting a vulnerability | ||||
------------ | ------------ | ||||
See [SECURITY.md](SECURITY.md) | See [SECURITY.md](SECURITY.md) |