Skip to content

[#372] Enhance coverage script to generate branch coverage reports for workspace and individual components#1350

Open
Afshankk wants to merge 1 commit intoeclipse-iceoryx:mainfrom
Afshankk:iox2-372
Open

[#372] Enhance coverage script to generate branch coverage reports for workspace and individual components#1350
Afshankk wants to merge 1 commit intoeclipse-iceoryx:mainfrom
Afshankk:iox2-372

Conversation

@Afshankk
Copy link
Contributor

@Afshankk Afshankk commented Feb 11, 2026

Notes for Reviewer

This PR enhances the coverage script (internal/scripts/generate-cov-report.sh) to support branch coverage reporting and per-component coverage generation.

Key Changes:

  • Added --branches flag to enable branch coverage in reports (for both Rust and C++)
  • Added --component <name> flag to generate coverage for specific components (can be used multiple times)
  • Updated show_overview() and show_report() functions to support branch coverage filtering
  • Modified generate_rust_profile() to support testing individual components via cargo test -p
  • Enhanced generate_report() to dynamically build ignore patterns for component filtering
  • Updated GitHub Actions workflow to include branch coverage in CI/CD pipeline
  • Improved help documentation with usage examples

Testing:
The script now supports multiple usage patterns:

  1. Full workspace with branch coverage: ./generate-cov-report.sh --full --branches
  2. Single component: ./generate-cov-report.sh --generate --html --component iceoryx2-cal
  3. Multiple components: ./generate-cov-report.sh --html --component iceoryx2 --component iceoryx2-cal --branches

Documentation:

  1. Updated release notes in doc/release-notes/iceoryx2-unreleased.md under Workflow section
  2. Enhanced script help with examples

Pre-Review Checklist for the PR Author

  • Add sensible notes for the reviewer
  • PR title is short, expressive and meaningful
  • Consider switching the PR to a draft (Convert to draft)
  • Relevant issues are linked in the References section
  • Branch follows the naming format (iox2-372)
  • Commits messages are according to this guideline
  • Commit messages have the issue ID ([#372])
  • Tests follow the best practice for testing
  • Changelog updated in the unreleased section including API breaking changes
  • Assign PR to reviewer
  • All checks have passed (except task-list-completed)

References

Closes #372

…rage reports for workspace and individual components
@dkroenke dkroenke self-requested a review February 11, 2026 10:45
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.80%. Comparing base (76c810e) to head (df09280).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1350      +/-   ##
==========================================
- Coverage   77.81%   77.80%   -0.02%     
==========================================
  Files         412      412              
  Lines       39008    39008              
  Branches     1256     1256              
==========================================
- Hits        30354    30350       -4     
- Misses       7621     7625       +4     
  Partials     1033     1033              
Flag Coverage Δ
CPP 68.04% <ø> (ø)
Rust 77.65% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 5 files with indirect coverage changes

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

Comment on lines +220 to +222
if [[ $SHOW_BRANCHES == "1" ]]; then
GCOVR_BRANCH_FLAG="--branches"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this flag has any effect because we see the branch coverage already in the existing report for the C++ Code and this flag is in gcovr marked as deprecated and affects only the txt output.
When comparing the reports where the flag is enabled/disabled there seems to be no difference.

echo " -l|--lcov - creates lcov report"
echo " -t|--html - creates html report"
echo " -f|--full - generate coverage report and create html and lcov"
echo " -b|--branches - include branch coverage in reports"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The branch coverage can be enabled by default so that the additional parameter here is not needed.

echo " $0 --generate --html --component iceoryx2-cal"
echo
echo " Generate coverage for multiple components:"
echo " $0 --generate --html --component iceoryx2 --component iceoryx2-cal"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this command and it generates an empty report for the Rust code. The target folder was cleaned up before. It could be maybe related to the handling of GRCOV_IGNORES in the generate_report() function.
The Rust build and test respects the component setting correctly.

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

Successfully merging this pull request may close these issues.

Adjust internal/scripts/generate-coverage.sh to use source-coverage

2 participants