-
-
Notifications
You must be signed in to change notification settings - Fork 27
Switching to llvm source based coverage. #385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
|
@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] <[email protected]> Co-authored-by: thirtytwobits <[email protected]>
|



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