You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have a zephyr workspace style project, and I recently added ztest unit tests to it, and started using twister to execute the tests and generate code coverage. Everything is working great, except in my code coverage report the only files it reports on are files in the zephyr repo. I have several other repos (my own included) that are contributing files, and none of those files shows up in the code coverage report. Also all of the file paths in the code coverage report are relative to zephyr, which I find odd since I would hope it would report on files outside of zephyr
This is a test running on the native_sim platform on a Ubuntu host.
I am using gcov and gcovr.
To Reproduce
Steps to reproduce the behavior:
Create zephyr workspace style project
Add some source code to a folder outside zephyr
Add a unit test project outside zephyr that uses that source code from step 2
Use twister to compile, and execute the unit test, and generate a code coverage report (use --coverage)
View generated code coverage report and see that code from outside zephyr repo is not included.
Expected behavior
I would expect the code coverage to include all source files used to generate the code.
And honestly I only care about the files from my repository. I would love a way to specify directories I want included in the code coverage report. But I am happy to post process the report myself and strip out the information I don't want.
Impact
This is annoying because ultimately if I can't get it to work then I have to generate the report myself, which I see the gcda and gcno files for the source I am interested in. So I guess there is probably a way to generate this myself, but I was so happy when I thought twister would do all this for me.
Logs and console output coverage.zip
These are the files for the coverage generated for a unit test whose main.c calls all the functions in my source file called database.c, and I don't see database.c in that report.
Environment (please complete the following information):
OS: Linux (ubuntu 22.04)
Toolchain 0.16.8
Commit SHA or Version used 4.0.0
Additional context
I don't know what else would be helpful. But I am happy to provide as much information as I can.
Also I hope I am not just being a fool. Thanks for your help.
The text was updated successfully, but these errors were encountered:
Describe the bug
I have a zephyr workspace style project, and I recently added ztest unit tests to it, and started using twister to execute the tests and generate code coverage. Everything is working great, except in my code coverage report the only files it reports on are files in the zephyr repo. I have several other repos (my own included) that are contributing files, and none of those files shows up in the code coverage report. Also all of the file paths in the code coverage report are relative to zephyr, which I find odd since I would hope it would report on files outside of zephyr
This is a test running on the native_sim platform on a Ubuntu host.
I am using gcov and gcovr.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect the code coverage to include all source files used to generate the code.
And honestly I only care about the files from my repository. I would love a way to specify directories I want included in the code coverage report. But I am happy to post process the report myself and strip out the information I don't want.
Impact
This is annoying because ultimately if I can't get it to work then I have to generate the report myself, which I see the gcda and gcno files for the source I am interested in. So I guess there is probably a way to generate this myself, but I was so happy when I thought twister would do all this for me.
Logs and console output
coverage.zip
These are the files for the coverage generated for a unit test whose main.c calls all the functions in my source file called database.c, and I don't see database.c in that report.
Environment (please complete the following information):
Additional context
I don't know what else would be helpful. But I am happy to provide as much information as I can.
Also I hope I am not just being a fool. Thanks for your help.
The text was updated successfully, but these errors were encountered: