From 912d7b7eea3d7c1f5f1879487690b1dd84c13f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vedran=20Mileti=C4=87?= Date: Mon, 9 Mar 2020 20:55:17 +0100 Subject: Document the requirement to run tests before coverage [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vedran Miletić --- docs/markdown/Feature-autodetection.md | 5 +++++ docs/markdown/Unit-tests.md | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/markdown/Feature-autodetection.md b/docs/markdown/Feature-autodetection.md index a4e8e45..c1b7659 100644 --- a/docs/markdown/Feature-autodetection.md +++ b/docs/markdown/Feature-autodetection.md @@ -32,3 +32,8 @@ reports can then be produced simply by calling e.g. `ninja coverage-xml`. As a convenience, a high-level *coverage* target is also generated which will produce all 3 coverage report types, if possible. + +Note that generating any of the coverage reports described above +requires the tests (i.e. `ninja test`) to finish running so the +information about the functions that are called in the tests can be +gathered for the report. diff --git a/docs/markdown/Unit-tests.md b/docs/markdown/Unit-tests.md index 97ee867..0785549 100644 --- a/docs/markdown/Unit-tests.md +++ b/docs/markdown/Unit-tests.md @@ -36,7 +36,17 @@ This feature can be disabled as discussed in [test()](Reference-manual.md#test). ## Coverage -If you enable coverage measurements by giving Meson the command line flag `-Db_coverage=true`, you can generate coverage reports. Meson will autodetect what coverage generator tools you have installed and will generate the corresponding targets. These targets are `coverage-xml` and `coverage-text` which are both provided by [Gcovr](http://gcovr.com) (version 3.3 or higher) and `coverage-html`, which requires [Lcov](https://ltp.sourceforge.io/coverage/lcov.php) and [GenHTML](https://linux.die.net/man/1/genhtml) or [Gcovr](http://gcovr.com). As a convenience, a high-level `coverage` target is also generated which will produce all 3 coverage report types, if possible. +If you enable coverage measurements by giving Meson the command line flag +`-Db_coverage=true`, you can generate coverage reports after running the tests +(running the tests is required to gather the list of functions that get +called). Meson will autodetect what coverage generator tools you have installed +and will generate the corresponding targets. These targets are `coverage-xml` +and `coverage-text` which are both provided by [Gcovr](http://gcovr.com) +(version 3.3 or higher) and `coverage-html`, which requires +[Lcov](https://ltp.sourceforge.io/coverage/lcov.php) and +[GenHTML](https://linux.die.net/man/1/genhtml) or +[Gcovr](http://gcovr.com). As a convenience, a high-level `coverage` target is +also generated which will produce all 3 coverage report types, if possible. The output of these commands is written to the log directory `meson-logs` in your build directory. -- cgit v1.1