From 8f4fbe526c004e21a755a25b44ac20bcddcffacc Mon Sep 17 00:00:00 2001 From: Per Held Date: Thu, 4 Jun 2026 21:30:03 +0200 Subject: [PATCH] Extend CPPCHECK scope to kernel tests Remove the broad kernels/test CPPCHECK exclusion and keep the remaining suppressions scoped to that tree. Kernel tests use fixture helpers, generated-style test data, and GTest macros that cppcheck cannot consistently resolve as direct use sites. Suppress those test-harness findings locally while keeping the rest of the CPPCHECK configuration active for kernels/test. Signed-off-by: Per Held Change-Id: I033afb7b59b961a99d6716ff3faa068a0eed2f6a --- .lintrunner.toml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.lintrunner.toml b/.lintrunner.toml index 2459970d88a..777e9f021f9 100644 --- a/.lintrunner.toml +++ b/.lintrunner.toml @@ -195,7 +195,6 @@ exclude_patterns = [ # Kernel areas to onboard separately. 'kernels/optimized/**', 'kernels/portable/**', - 'kernels/test/**', # Runtime areas to onboard incrementally. 'runtime/backend/**', @@ -234,6 +233,16 @@ command = [ '--extra-arg=--suppress=unusedFunction:*kernels/quantized/*', '--extra-arg=--suppress=constParameterReference:*kernels/quantized/*', '--extra-arg=--suppress=suspiciousFloatingPointCast:*kernels/quantized/*', + # Kernel tests use fixture helpers, generated-style test cases, and GTest + # macros that cppcheck cannot consistently resolve as direct use sites. + '--extra-arg=--suppress=unusedFunction:*kernels/test/*', + '--extra-arg=--suppress=unreadVariable:*kernels/test/*', + '--extra-arg=--suppress=unknownMacro:*kernels/test/*', + '--extra-arg=--suppress=syntaxError:*kernels/test/*', + '--extra-arg=--suppress=passedByValue:*kernels/test/*', + '--extra-arg=--suppress=duplicateBranch:*kernels/test/*', + '--extra-arg=--suppress=useStlAlgorithm:*kernels/test/*', + '--extra-arg=--suppress=functionStatic:*kernels/test/*', '--', '@{{PATHSFILE}}' ]