Repository navigation
Conversation
RandLAPACK had no coverage measurement. This adds one, as a signal rather than a gate. - RandLAPACK_ENABLE_COVERAGE (GCC only): test/CMakeLists.txt instruments the C++ test translation units with --coverage at -O0, which is where a header-only library's code is compiled, and warns if the build type is not Debug. - test/misc/test_instantiations.cc explicitly instantiates, for float and double and in headers no open PR touches, class templates and the member and function templates the tests miss (BK's sparse-matrix call, the sparse-matrix and sketching-operator applies of SparseLinOp and CompositeOperator, standardize_dataset). An uninstantiated template contributes no lines to gcov, so it was invisible rather than uncovered. test/drivers/test_instantiations_gpu.cu does the same for the two GPU drivers in the CUDA test executable. - The coverage workflow builds and runs the core suite that way, reports with gcovr (HTML artifact, summary on the job page, Cobertura XML) and uploads to Codecov through OpenID Connect with informational statuses (codecov.yml), so nothing is blocked on a percentage. Lines are merged across template instantiations; functions are counted per instantiation, and branches merge only where the instantiations' control flow matches, so untested float versions can lower those two numbers. - docs/CI.md (the job, what its numbers count, a local recipe), CONTRIBUTING.md and docs/INSTALL_MANUAL.md describe the option. Verified locally (GCC 15.2, oneMKL ILP64, RTX 5070 Ti), on 18ddced: - Debug build with the option, reported with the local recipe in docs/CI.md: 531 of 533 tests passed, 2 skipped (thread-cap tests); lines 4484/5258 (85.3%), branches 3413/6878, functions 521/728. - Release build with CUDA: 587 of 589 tests passed (CPU and GPU, ctest -LE exclusive), the same 2 skipped; every float instantiation compiles. - On c970693, before this commit the report read lines 4326/5058, branches 3232/6109, functions 470/552; with it, lines 4326/5094. Fixes #127.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
This was referenced Oct 29, 2026
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.
Summary
Adds code coverage measurement for the library: a GCC build option that instruments the test suite, an instantiation file so template code no test instantiates is counted instead of invisible, and a
coverageCI job that reports through gcovr and Codecov. Coverage is reported, not enforced: the job is not a required check and the Codecov statuses are informational.Changes
RandLAPACK_ENABLE_COVERAGE(CMake option, GCC only, default OFF):test/CMakeLists.txtadds--coverage -O0 -g -fprofile-abs-path -fprofile-update=prefer-atomicto the C++ test translation units, which is where a header-only library's code is compiled, and warns if the build type is not Debug. CUDA sources are not instrumented.test/misc/test_instantiations.cc: explicitfloatanddoubleinstantiations, in headers no open PR touches, of class templates and of the member and function templates the tests miss (BK's sparse-matrixcall, the sparse-matrix and sketching-operator applies ofSparseLinOpandCompositeOperator, andstandardize_dataset, which no test calls). gcov sees a template's lines only once something instantiates it; the file also compiles thefloatversions no test builds.test/drivers/test_instantiations_gpu.cudoes the same for BQRRP_GPU and CQRRPT_GPU in the CUDA test executable..github/workflows/coverage.yaml: a Debug build with the option, the core test suite, then gcovr filtered toRandLAPACK/. Outputs: an HTML report as thecoverage-reportartifact, a summary on the job page, and Cobertura XML uploaded to Codecov through OpenID Connect (no stored token; the action is pinned to a commit).codecov.yml: informational project and patch statuses; tests, benchmarks, extras and the RandBLAS submodule ignored.docs/CI.md(the job, what its numbers count, the local recipe),CONTRIBUTING.md(a note for contributors),docs/INSTALL_MANUAL.md(the option).Lines are merged across template instantiations, so a line counts as covered if any instantiation ran it; functions are counted per instantiation, and branches merge only where the instantiations' control flow matches, so untested
floatversions can lower those two numbers. On main at18ddcedbwith this PR the report reads lines 4484/5258 (85.3%), branches 3413/6878, functions 521/728. Measured onc9706937, the instantiation file takes the line count from 4326/5058 to 4326/5094.Codecov is already active for this repository: the first run of the job uploaded its report, and Codecov commented on this PR.
Fixes #127.