Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot generate code coverage report for unit tests using sanitycheck #24674

Closed
thoh-ot opened this issue Apr 24, 2020 · 2 comments · Fixed by #24780
Closed

Cannot generate code coverage report for unit tests using sanitycheck #24674

thoh-ot opened this issue Apr 24, 2020 · 2 comments · Fixed by #24780
Assignees
Labels
area: Sanitycheck Sanitycheck has been renamed to Twister bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@thoh-ot
Copy link
Collaborator

thoh-ot commented Apr 24, 2020

To Reproduce
Steps to reproduce the behavior:

  1. sanitycheck -p unit_testing --coverage
  2. See error

Expected behavior
Code coverage rapport for the unit tests in Zephyr.

Impact
Annoyance; we wan't to introduce new unit tests of the Zephyr Bluetooth controller code and the coverage rapport is a very valuable tool in that matter.

Environment (please complete the following information):

  • OS: Linux (CentOS 7)
  • Toolchain: zephyrsdk-0.11.1
  • Commit: 84817f4
@thoh-ot thoh-ot added bug The issue is a bug, or the PR is fixing a bug area: Sanitycheck Sanitycheck has been renamed to Twister area: Testing labels Apr 24, 2020
@pabigot
Copy link
Collaborator

pabigot commented Apr 28, 2020

AFAIK coverage is only supported when you use --platform qemu_x86_coverage.

@pabigot
Copy link
Collaborator

pabigot commented Apr 28, 2020

This is the error I get; not sure if it's what was observed.

tirzah[381]$ sanitycheck -p unit_testing --coverage
Renaming output directory to /mnt/nordic/zp/zephyr/sanity-out.4
INFO    - JOBS: 32
INFO    - Building initial testcase list...
INFO    - 11 test configurations selected, 0 configurations discarded due to filters.
INFO    - Adding tasks to the queue...
INFO    - Total complete:   11/  11  100%  skipped:    0, failed:    0
INFO    - 11 of 11 tests passed (100.00%), 0 failed, 0 skipped with 0 warnings in 3.59 seconds
INFO    - In total 817 test cases were executed on 1 out of total 243 platforms (0.41%)
INFO    - Generating coverage files...
geninfo: WARNING: no .gcda files found in /mnt/nordic/zp/zephyr/sanity-out - skipping!
lcov: ERROR: no valid records found in tracefile /mnt/nordic/zp/zephyr/sanity-out/coverage.info
lcov: ERROR: no valid records found in tracefile /mnt/nordic/zp/zephyr/sanity-out/coverage.info
lcov: ERROR: no valid records found in tracefile /mnt/nordic/zp/zephyr/sanity-out/coverage.info
lcov: ERROR: no valid records found in tracefile /mnt/nordic/zp/zephyr/sanity-out/coverage.info
genhtml: ERROR: no valid records found in tracefile /mnt/nordic/zp/zephyr/sanity-out/coverage.info

@carlescufi carlescufi added the priority: low Low impact/importance bug label Apr 28, 2020
nashif added a commit to nashif/zephyr that referenced this issue Apr 28, 2020
Fix setting coverage for unit tests and link against gcov when coverage
is enabled.

Fixes zephyrproject-rtos#24674

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
nashif added a commit that referenced this issue Apr 29, 2020
Fix setting coverage for unit tests and link against gcov when coverage
is enabled.

Fixes #24674

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
sandeepbrcm pushed a commit to Broadcom/zephyr that referenced this issue Apr 30, 2020
Fix setting coverage for unit tests and link against gcov when coverage
is enabled.

Fixes zephyrproject-rtos#24674

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
hakehuang pushed a commit to hakehuang/zephyr that referenced this issue Jun 20, 2020
Fix setting coverage for unit tests and link against gcov when coverage
is enabled.

Fixes zephyrproject-rtos#24674

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Sanitycheck Sanitycheck has been renamed to Twister bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants