Add CMake configurations for code coverage and analysis tools#7
Merged
royratcliffe merged 15 commits intomainfrom Mar 1, 2026
Merged
Add CMake configurations for code coverage and analysis tools#7royratcliffe merged 15 commits intomainfrom
royratcliffe merged 15 commits intomainfrom
Conversation
Introduce settings for lcov, cppcheck, and Doxygen in CMake files. Create necessary configuration files to enable code coverage and static analysis during the Debug build type. This enhances the development workflow by integrating coverage reports and code quality checks.
There was a problem hiding this comment.
Pull request overview
Adds CMake-driven developer tooling for coverage, static analysis, and documentation generation, aiming to integrate these workflows into Debug builds.
Changes:
- Introduces new CMake modules for lcov/genhtml coverage, cppcheck analysis, and Doxygen docs.
- Wires the new modules into the top-level
CMakeLists.txtviaCMAKE_MODULE_PATHandinclude(...). - Adds VS Code settings to pick up generated coverage info and trigger a coverage target.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
cmake/lcov.cmake |
Adds coverage instrumentation flags and custom targets for lcov/genhtml reporting. |
cmake/cppcheck.cmake |
Adds a cppcheck custom target intended to analyze via compile_commands.json. |
cmake/doxy.cmake |
Extracts Doxygen configuration/target creation into a reusable module. |
CMakeLists.txt |
Sets module path and includes the new analysis/coverage/doc modules. |
cppcheck_suppressions.txt |
Adds a suppressions list file for cppcheck. |
.vscode/settings.json |
Configures VS Code/CMake Tools to consume and run coverage outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Correct the spelling in the function documentation for blit_rgn1_norm to adhere to British English conventions.
Update function names and documentation to replace 'slip' with 'move' for consistency. Adjust comments to reflect the changes in functionality for better understanding of region adjustments.
Clarify that the 'lcov' target is only defined when lcov is installed and the build type is Debug. Mention potential failures in other configurations.
Update the CMake configuration to append the current source directory to the CMAKE_MODULE_PATH, ensuring proper module inclusion for lcov, doxy, and cppcheck.
Change return type of blit_rgn1_rop2 and blit_rop2 functions from bool to int to indicate the number of logic operations performed. Update documentation to reflect this change and ensure accurate counting of operations, including those that do not alter pixel values.
Update the parameter formatting in the blit_rop2 function to clearly distinguish between destination and source regions, as well as the raster operation. This enhances the function's interface for better understanding and usage.
Adjust function signatures in rop2.c to align parameters on a single line, enhancing readability. This includes typedefs and function declarations for raster operations and logic functions.
Updated the Doxygen configuration to specify the full path for the main page file, ensuring accurate documentation generation.
Update cppcheck command to use configuration-aware logic, ensuring it only runs when building the Debug configuration. Improve comments for better understanding of the code analysis process.
Refactor CMake configuration to allow code coverage analysis regardless of the build type. Update target_compile_options and target_link_options to use generator expressions for conditional coverage flags. Add dependency for lcov target on ctest to ensure tests are run before coverage is captured.
Add compiler and linker flags for code coverage analysis to the blit and test_runner targets. This ensures that coverage is only enabled for Debug builds, optimising performance for Release builds.
Include a new test for extra_scan_count in the test suite to ensure correct functionality of the scanline operations. This test checks the expected output against the defined patterns.
Introduce a new launch configuration for gdb with setup commands for pretty-printing and Intel disassembly flavour. This enhances the debugging experience for users working with gdb.
This change allows tools like cppcheck and clang-tidy to access the compilation commands and flags used in the project, improving the accuracy of their analysis and reporting.
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.
Introduce settings for lcov, cppcheck, and Doxygen in CMake files. Create necessary configuration files to enable code coverage and static analysis during the Debug build type. This enhances the development workflow by integrating coverage reports and code quality checks.