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

Apply lcov settings to generate code coverage report #21

Open
utilForever opened this issue Feb 12, 2019 · 0 comments
Open

Apply lcov settings to generate code coverage report #21

utilForever opened this issue Feb 12, 2019 · 0 comments
Assignees
Labels

Comments

@utilForever
Copy link
Owner

utilForever commented Feb 12, 2019

This revision sets lcov to generate code coverage report.

CAUTION
lcov --directory . --capture --output-file coverage.info doesn't work. I added the compiler flag and link flag, and when I built it, the .gcno file was created, but the .gcda file was not created. It seems to be a problem caused by the updated version of gcov. (WARNING: no .gcda files found in .)

The following is a list of commands to print a report using lcov.

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j 8
lcov -c -i -d Tests/UnitTests -o base.info
bin/UnitTests
lcov -c -d Tests/UnitTests -o test.info
lcov -a base.info -a test.info -o coverage.info
lcov -r coverage.info '/usr/*' -o coverage.info
lcov -r coverage.info '*/Libraries/*' -o coverage.info
lcov -r coverage.info '*/Tests/*' -o coverage.info
lcov -l coverage.info
genhtml coverage.info -o out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant