Skip to content

Add CMake configurations for code coverage and analysis tools#7

Merged
royratcliffe merged 15 commits intomainfrom
patch-7
Mar 1, 2026
Merged

Add CMake configurations for code coverage and analysis tools#7
royratcliffe merged 15 commits intomainfrom
patch-7

Conversation

@royratcliffe
Copy link
Copy Markdown
Owner

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.

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.
Copilot AI review requested due to automatic review settings March 1, 2026 08:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.txt via CMAKE_MODULE_PATH and include(...).
  • 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.

Comment thread cmake/lcov.cmake
Comment thread cmake/doxy.cmake Outdated
Comment thread cmake/cppcheck.cmake
Comment thread cmake/cppcheck.cmake Outdated
Comment thread cmake/cppcheck.cmake Outdated
Comment thread .vscode/settings.json
Comment thread CMakeLists.txt Outdated
Comment thread cmake/lcov.cmake Outdated
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.
@royratcliffe royratcliffe merged commit 4228d33 into main Mar 1, 2026
4 checks passed
@royratcliffe royratcliffe deleted the patch-7 branch March 1, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants