Switching to llvm source based coverage.#385
Merged
thirtytwobits merged 3 commits into3.0.previewfrom Dec 19, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the C/C++ code coverage infrastructure from lcov/genhtml-based coverage to LLVM source-based code coverage, providing more accurate and modern coverage reporting capabilities.
Key Changes:
- Replaces lcov/genhtml toolchain with LLVM's source-based coverage tools (llvm-cov and llvm-profdata)
- Integrates CTest for test discovery and execution
- Adds comprehensive test presets for different configurations
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| verification/cmake/utils.cmake | Removes deprecated define_native_test_run function no longer needed with CTest integration |
| verification/cmake/modules/Findverification-coverage.cmake | Completely rewritten to find LLVM coverage tools (llvm-cov, llvm-profdata) instead of lcov |
| verification/cmake/modules/Findgenhtml.cmake | Entire file deleted as genhtml is replaced by llvm-cov for HTML report generation |
| verification/cmake/compiler_flag_sets/common.cmake | Updates coverage compiler/linker flags to use LLVM instrumentation (-fprofile-instr-generate, -fcoverage-mapping) instead of gcov flags |
| verification/CMakePresetsVendorTemplate.json | Changes build targets from "test_all" to "all" and removes redundant workflow metadata |
| verification/CMakePresets.json | Changes all build targets from "test_all" to "all", removes redundant workflow display names/descriptions, adds 6 new test presets for CTest integration |
| verification/CMakeLists.txt | Major refactoring: enables CTest, renames functions (runTestCpp→compileTestCpp, runTestC→compileTestC), removes lcov-based coverage in favor of LLVM coverage pipeline with profdata merging and multi-format report generation |
| CONTRIBUTING.rst | Updates documentation to explain LLVM coverage workflow, output locations, and commands |
| .vscode/settings.json | Adds SonarLint connected mode configuration |
| .vscode/extensions.json | Removes deprecated Catch2 test adapter extension |
| .github/workflows/test.yml | Updates coverage artifact paths and container image version to ts24.4.3 |
| .devcontainer/toolshed-cov-arm64/devcontainer.json | Entire file deleted - coverage-specific devcontainer no longer needed |
| .devcontainer/toolshed-cov-amd64/devcontainer.json | Entire file deleted - coverage-specific devcontainer no longer needed |
| .devcontainer/toolshed-arm64/devcontainer.json | Removes Catch2 test adapter extension |
| .devcontainer/toolshed-amd64/devcontainer.json | Removes Catch2 test adapter extension |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@thirtytwobits I've opened a new pull request, #386, to work on those changes. Once the pull request is ready, I'll request review from you. |
Addresses feedback from #385 to use the CMake variable found by `Findverification-coverage.cmake` instead of hardcoding the tool name. ## Changes - Pass `LLVM_COV` to generated coverage script via `set(LLVM_COV "${LLVM_COV}")` - Replace hardcoded `llvm-cov` with `\${LLVM_COV}` in all `execute_process()` commands (4 occurrences) This matches the existing pattern for `LLVM_PROFDATA` and ensures the build uses the tool path discovered by CMake's find_program() rather than assuming it's in PATH. ```cmake # Before execute_process( COMMAND llvm-cov show -format=html ... ) # After execute_process( COMMAND \${LLVM_COV} show -format=html ... ) ``` <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thirtytwobits <19180861+thirtytwobits@users.noreply.github.com>
|
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.



A much better way to generate source coverage for C++