Repository navigation
Add gcovr-based code coverage: a cmake target and a Codecov CI report - #2897
Merged
cary-ilm merged 2 commits intoNov 27, 2026
Merged
Conversation
Add OPENEXR_ENABLE_COVERAGE, which instruments the build with gcov and adds 'coverage', 'coverage-report' and 'coverage-clean' targets that run the tests and generate an HTML report (plus Cobertura XML and a JSON summary) with gcovr. The measured files are configured in gcovr.cfg. CONTRIBUTING.md describes how to use the targets locally. Add coverage.yml, which builds with coverage enabled, runs the full test suite, and produces the same gcovr report. The instrumented build and full test run are slow, so it runs weekly (Sunday, after the full build), repo, on demand via workflow_dispatch on any branch, and on a pull request when a maintainer applies the 'coverage' label. Each run: - uploads the HTML report as an artifact; - writes overall line/function/branch percentages to the job summary; - uploads the Cobertura report to Codecov, which tracks the coverage of main over time and shows the coverage of the changed lines on a pull request. codecov.yml makes the Codecov project and patch statuses informational, so a pull request is never failed for low coverage. gcovr is installed from a hash-pinned requirements file, share/ci/requirements/coverage.txt, generated from coverage.in. Assisted-by: Copilot / Claude Sonnet 5.5 Signed-off-by: Cary Phillips <seabeepea@gmail.com>
cary-ilm
merged commit Nov 27, 2026
01ee8f7
into
AcademySoftwareFoundation:main
38 of 39 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alternative to #2872, using codecov
Add OPENEXR_ENABLE_COVERAGE, which instruments the build with gcov and adds 'coverage', 'coverage-report' and 'coverage-clean' targets that run the tests and generate an HTML report (plus Cobertura XML and a JSON summary) with gcovr. The measured files are configured in gcovr.cfg. CONTRIBUTING.md describes how to use the targets locally.
Add coverage.yml, which builds with coverage enabled, runs the full test suite, and produces the same gcovr report. The instrumented build and full test run are slow, so it runs weekly (Sunday, after the full build), repo, on demand via workflow_dispatch on any branch, and on a pull request when a maintainer applies the 'coverage' label.
Each run:
codecov.yml makes the Codecov project and patch statuses informational, so a pull request is never failed for low coverage.
gcovr is installed from a hash-pinned requirements file, share/ci/requirements/coverage.txt, generated from coverage.in.
Assisted-by: Copilot / Claude Sonnet 5.5