Skip to content

Conversation

jasgaa
Copy link

@jasgaa jasgaa commented Aug 12, 2025

Fixes #40.

@christophebedard
Copy link
Member

So we should still support Ubuntu 22.04, which has lcov version 1.15 (or 1.14 according to lcov --version): https://packages.ubuntu.com/jammy/lcov. Unfortunately, that version doesn't seem to accept branch_coverage according to man lcovrc. It might still support branch_coverage instead of lcov_branch_coverage, but I can't currently test.

In that case, you could get the lcov version (by running lcov --version, capturing the output, and extracting the version number from that) and use branch_coverage instead of lcov_branch_coverage if the version is >=2.0. You would have to create a second version of the lcovrc file (e.g., colcon_lcov_result/verb/configuration/lcovrc1 for the older version of lcov and colcon_lcov_result/verb/configuration/lcovrc for the newer version) and use the right one depending on the version of lcov as well.

@christophebedard
Copy link
Member

I've fixed the test failure, so you can rebase your branch on master to get rid of it.

@jasgaa jasgaa force-pushed the fix/deprecated-lcov-arguments branch from eadd7f8 to 1261818 Compare August 15, 2025 07:48
@codecov-commenter
Copy link

codecov-commenter commented Aug 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.94%. Comparing base (58db50b) to head (1261818).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #41   +/-   ##
=======================================
  Coverage   95.94%   95.94%           
=======================================
  Files           3        3           
  Lines          74       74           
  Branches       11       11           
=======================================
  Hits           71       71           
  Misses          2        2           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jasgaa
Copy link
Author

jasgaa commented Aug 18, 2025

branc_coverage seems to work in Ubuntu 22 (added the distro to WSL for a quick test)

image

However I can also add the mechanism to detect lcov version, what do you think @christophebedard?

@christophebedard
Copy link
Member

christophebedard commented Aug 25, 2025

I don't think that actually means it's valid. For example, with a random name:

$ lcov --version
lcov: LCOV version 1.14
$ lcov --rc eihrihduifiddjipfh8difidnjfiujfbhidp
lcov: Option rc, key "eihrihduifiddjipfh8difidnjfiujfbhidp", requires a value
lcov: Need one of options -z, -c, -a, -e, -r, -l, --diff or --summary
Use lcov --help to get usage information

It might still be supported, but you would need to fully test lcov/colcon lcov-result with it to find out. You can install your branch of colcon lcov-result using pip or a venv (https://github.com/colcon/colcon-lcov-result#contributing) and try it out https://github.com/colcon/colcon-lcov-result#usage

@jasgaa
Copy link
Author

jasgaa commented Aug 27, 2025

You are right, my testing method was inadequate. I will do some more testing and the necessary tweaks if needed.

Unfortunately, I found that this is not really the biggest problem when using this package on Ubuntu 24. When using Google test, I got a large number of geninfo errors and warnings from a package whose code coverage testing on Ubuntu 20 worked without any problems.

Found this issue from lcov package, and based on the info I created a simple bash script to replace this package in my CI environment at least for now.

@christophebedard
Copy link
Member

Yeah, I've had similar issues and haven't been using lcov/colcon lcov-result that much recently.

I think it's probably safe to assume that branch_coverage isn't supported before version 2, so we'd need to check the version with lcov --version and use the right one. However, if you prefer to close this PR (not the issue), that's fine of course.

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

Successfully merging this pull request may close these issues.

RC option 'lcov_branch_coverage' is deprecated warning from hard-coded argument
3 participants