Skip to content

Commit

Permalink
twister: coverage: GCOVR as defautlt coverage reporting tool
Browse files Browse the repository at this point in the history
Twister now uses GCOVR by default as the more reliable code
coverage reporting tool instead of LCOV.

(cherry picked from commit 8e3a3b4)

Original-Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
GitOrigin-RevId: 8e3a3b4
Change-Id: If4c9d10d8422dcfa43b24f13d571df7311669b75
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5149747
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Tested-by: Fabio Baltieri <fabiobaltieri@google.com>
  • Loading branch information
golowanow authored and Chromeos LUCI committed Dec 23, 2023
1 parent a506d4a commit 8882e4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion doc/develop/test/coverage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ or::

$ twister --coverage -p native_sim -T tests/bluetooth

which will produce ``twister-out/coverage/index.html`` with the report.
which will produce ``twister-out/coverage/index.html`` report as well as
the coverage data collected by ``gcovr`` tool in ``twister-out/coverage.json``.

Other reports might be chosen with ``--coverage-tool`` and ``--coverage-formats``
command line options.

The process differs for unit tests, which are built with the host
toolchain and require a different board::
Expand Down
2 changes: 1 addition & 1 deletion scripts/pylib/twister/twisterlib/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def add_parse_arguments(parser = None):
"This option may be used multiple times. "
"Default to what was selected with --platform.")

parser.add_argument("--coverage-tool", choices=['lcov', 'gcovr'], default='lcov',
parser.add_argument("--coverage-tool", choices=['lcov', 'gcovr'], default='gcovr',
help="Tool to use to generate coverage report.")

parser.add_argument("--coverage-formats", action="store", default=None, # default behavior is set in run_coverage
Expand Down

0 comments on commit 8882e4b

Please sign in to comment.