From 75dd8f237f42d472854677dcbab2589383f88177 Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Sun, 29 Dec 2019 21:52:01 +0100 Subject: [PATCH] README: add a section for test coverage It is a hassle to figure out the exact commands to create a good report. --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index c18e43db5e..cee3d7a0c6 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,25 @@ With valgrind, you might need to increase the max stack size: $ valgrind --max-stackframe=2500000 ./exhaustive_tests +Test coverage +----------- + +To create a test coverage report, configure with `--enable-coverage` (use of GCC is necessary): + + $ ./configure --enable-coverage + +Run the tests: + + $ make check + +To create a report, `gcovr` is recommended, as it includes the coverage of all branches: + + $ gcovr --exclude 'src/bench*' --print-summary + +To create a HTML report with coloured and annotated source code: + + $ gcovr --exclude 'src/bench*' --html --html-details -o coverage.html + Reporting a vulnerability ------------