Document the requirement to run tests before coverage [skip ci]

Co-authored-by: Vedran Miletić <vedran@miletic.net>
pull/6764/head
Vedran Miletić 5 years ago committed by GitHub
parent cfb79d0316
commit 912d7b7eea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      docs/markdown/Feature-autodetection.md
  2. 12
      docs/markdown/Unit-tests.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.

@ -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.

Loading…
Cancel
Save