Skip to content
Browse files

doc: update coverage documentation

The sanitycheck defaults have changed, and the same options
work for emulators and native_posix.

Signed-off-by: Andrew Boie <>
  • Loading branch information...
andrewboie authored and aescolar committed Jul 4, 2019
1 parent 859ca42 commit f3c624c831a41e6bd9774ab346b2f2cfe4f46636
Showing with 7 additions and 15 deletions.
  1. +7 −15 doc/guides/coverage.rst
@@ -125,29 +125,21 @@ You may postprocess these with your preferred tools. For example:
genhtml --output-directory lcov_html -q --ignore-errors source --branch-coverage --highlight --legend

Sanitycheck coverage reports

When targeting boards based on the POSIX architecture,
Zephyr's :ref:`sanitycheck script <sanitycheck_script>` can automatically
generate a coverage report from the tests which were executed.
You just need to invoke it with the ``-C`` command line option.
You just need to invoke it with the ``--coverage`` command line option.

For example you may run::
For example, you may invoke::

$ sanitycheck -p native_posix -T tests/kernel -C
$ sanitycheck --coverage -p qemu_x86 -T tests/kernel

which will produce ``sanity-out/coverage/index.html`` with the report.

For emulated targets you will need to pass the correct ``gcov`` binary from
the SDK, the default of using the ``gcov`` found in the default path is likely
not going to work. For example, to produce reports using the
``qemu_x86_coverage`` target::

$ sanitycheck --coverage --coverage-platform=qemu_x86_coverage -p qemu_x86_coverage --gcov-tool $ZEPHYR_SDK_INSTALL_DIR/i586-zephyr-elf/bin/i586-zephyr-elf-gcov
$ sanitycheck --coverage -p native_posix -T tests/bluetooth

You can find the paths to all the ``gcov`` binaries in the SDK with::

$ find $ZEPHYR_SDK_INSTALL_DIR -iregex ".*gcov"
which will produce ``sanity-out/coverage/index.html`` with the report.

.. _gcov:

0 comments on commit f3c624c

Please sign in to comment.
You can’t perform that action at this time.