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

Add coverage to tests #55

Closed
3 tasks done
matheusgomes28 opened this issue Mar 28, 2023 · 4 comments
Closed
3 tasks done

Add coverage to tests #55

matheusgomes28 opened this issue Mar 28, 2023 · 4 comments

Comments

@matheusgomes28
Copy link
Owner

matheusgomes28 commented Mar 28, 2023

Add coverage reporting to unit tests. Difficult task!

TODOS 📑

  • Compile with --coverage in gcc. 📔
  • Integrate gcov and lcov to read the profiling data. 👓
  • Deploy coverage HTML to artifacts. 📫
@matheusgomes28
Copy link
Owner Author

matheusgomes28 commented Apr 5, 2023

Alternatively to gcov and lcov, you can integrate with codecov.

The plan is:

  • Build debug with coverage flags, --coverage suffices.
  • Calling lcov after the tests run: lcov --capture --directory . --output-file coverage.info from project dir suffices.
  • Remove the stl and conan files with lcov --remove coverage.info '/usr/*' --output-file coverage.info

Uploading the coverage info:

  • Create pipeline secret with Codecov PAT
  • Upload the coverage info with bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"

@matheusgomes28
Copy link
Owner Author

Perhaps the following would be necessary if there are issues with lcov finding the source files:

lcov -d BUILD/app/packages/ --capture --no-external --output-file app.info
     --rc geninfo_adjust_src_path="${PROJECT_ROOT}/build/unix-deb
     => ${PROJECT_ROOT}"

@matheusgomes28
Copy link
Owner Author

Turns out the docker container does not have lcov. Make sure we add this in, research a good lcov version to add.

@matheusgomes28
Copy link
Owner Author

Long but closed with #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant