This directory contains the cppcheck configuration and scripts used by the repository's static-analysis workflow.
cd tests/cppcheck
./cppcheck_focused.shcd tests\cppcheck
cppcheck_focused.batProject-specific library definitions that keep cppcheck aligned with the codebase's macros and helper APIs.
Focused-analysis suppressions for known cppcheck false positives and irrelevant warnings.
The focused scripts use both cppcheck_lib.cfg and cppcheck_suppressions.txt. The full scripts intentionally remain unsuppressed so they can expose the complete analyzer surface when a broader manual pass is requested.
run_cppcheck.sh- Full analysis for Linux/macOSrun_cppcheck.bat- Full analysis for Windowscppcheck_focused.sh- Focused analysis for Linux/macOScppcheck_focused.bat- Focused analysis for Windows
Full scripts write timestamped XML and text summaries to ../../test_results/.
Focused scripts print a terminal summary and do not persist reports.
cd tests/cppcheck
./run_cppcheck.sh
./cppcheck_focused.shfind_program(CPPCHECK cppcheck)
if(CPPCHECK)
add_custom_target(cppcheck
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/cppcheck/run_cppcheck.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/cppcheck
COMMENT "Running cppcheck analysis"
)
endif()When project-specific macros or helper functions change:
- Update
cppcheck_lib.cfg - Re-run the focused analysis
- Extend the library config only with targeted entries
If cppcheck starts reporting false positives, prefer a focused library-config update when the issue is macro/API modeling. Add suppressions only for confirmed analyzer noise that should stay filtered from the focused quality gate.