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

C++ coverage assumes that package name is the same as folder name #41

Open
josephduchesne opened this issue Jan 27, 2023 · 0 comments
Open

Comments

@josephduchesne
Copy link

My workplace uses the company name as a package prefix for internal ROS packages, and as a result most packages are "companyname_foo". To cut down to redundancy, these packages are checked out as just "foo". Unfortunately this line seems to depend on package name and package folder name being the same, since it's filtering out code that doesn't have the package name in the path:

COMMAND ${LCOV_PATH} --extract ${PROJECT_BINARY_DIR}/${Coverage_NAME}.info.removed "'*/${PROJECT_NAME}/*'" --output-file ${PROJECT_BINARY_DIR}/${Coverage_NAME}.info.cleaned || (exit 0)

The result is an empty code coverage folder.

I'm not sure what the cleanest way to fix this is though. I'd love to use this package.

Sanitised logfile:

Writing data to companyname_foldername_coverage_report.total
Summary coverage rate:
  lines......: 71.8% (244 of 340 lines)
  functions..: 48.5% (83 of 171 functions)
  branches...: no data found
/usr/bin/lcov --remove companyname_foldername_coverage_report.total */companyname_foldername/generated_cpp/* --output-file /home/companyname/Dev/catkin_ws/build/companyname_foldername/companyname_foldername_coverage_report.info.removed || ( exit 0 )
Reading tracefile companyname_foldername_coverage_report.total
Deleted 0 files
Writing data to /home/companyname/Dev/catkin_ws/build/companyname_foldername/companyname_foldername_coverage_report.info.removed
Summary coverage rate:
  lines......: 71.8% (244 of 340 lines)
  functions..: 48.5% (83 of 171 functions)
  branches...: no data found
/usr/bin/lcov --extract /home/companyname/Dev/catkin_ws/build/companyname_foldername/companyname_foldername_coverage_report.info.removed '*/companyname_foldername/*' --output-file /home/companyname/Dev/catkin_ws/build/companyname_foldername/companyname_foldername_coverage_report.info.cleaned || ( exit 0 )
Reading tracefile /home/companyname/Dev/catkin_ws/build/companyname_foldername/companyname_foldername_coverage_report.info.removed
Extracted 0 files
Writing data to /home/companyname/Dev/catkin_ws/build/companyname_foldername/companyname_foldername_coverage_report.info.cleaned
Summary coverage rate:
  lines......: no data found
  functions..: no data found
  branches...: no data found

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