Skip to content

Commit f2200eb

Browse files
committed
Filter cppcheck checkers report info from test output
Newer cppcheck versions include an informational line about active checkers. Filter this out in tests to maintain compatibility across versions.
1 parent bb01cc1 commit f2200eb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/test_hooks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,9 @@ def run_shell_cmd(cmd_name, files, args, _, target_output, target_retcode):
448448
# Output is unpredictable and platform/version dependent
449449
if any([f.endswith("err.cpp") for f in files]) and "-std=c++20" in args:
450450
actual = re.sub(rb"[\d,]+ warnings and ", b"", actual)
451+
# Newer cppcheck versions include a checkers report info line
452+
if cmd_name == "cppcheck":
453+
actual = re.sub(rb"nofile:0:0: information: Active checkers.*\n+", b"", actual)
451454
retcode = sp_child.returncode
452455
utils.assert_equal(target_output, actual)
453456
assert target_retcode == retcode

0 commit comments

Comments
 (0)