From 2471266f12a42d4f240dd3fbb23a73545a9602e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 17 Aug 2019 17:51:48 +0200 Subject: [PATCH] test/cli: test unmatchedSuppression handling separately --- test/cli/proj-inline-suppress/1.c | 4 ---- test/cli/proj-inline-suppress/2.c | 3 +++ test/cli/test-inline-suppress.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 test/cli/proj-inline-suppress/2.c diff --git a/test/cli/proj-inline-suppress/1.c b/test/cli/proj-inline-suppress/1.c index 440fbf7cf..490765b2d 100644 --- a/test/cli/proj-inline-suppress/1.c +++ b/test/cli/proj-inline-suppress/1.c @@ -1,5 +1 @@ #include <1.h> - -// cppcheck-suppress some_warning_id ; there should be a unmatchedSuppression warning about this -x; - diff --git a/test/cli/proj-inline-suppress/2.c b/test/cli/proj-inline-suppress/2.c new file mode 100644 index 000000000..541b01cb2 --- /dev/null +++ b/test/cli/proj-inline-suppress/2.c @@ -0,0 +1,3 @@ +// cppcheck-suppress some_warning_id ; there should be a unmatchedSuppression warning about this +x; + diff --git a/test/cli/test-inline-suppress.py b/test/cli/test-inline-suppress.py index eab10467b..c94c493af 100644 --- a/test/cli/test-inline-suppress.py +++ b/test/cli/test-inline-suppress.py @@ -16,6 +16,6 @@ def test2(): assert len(stderr) > 0 def test_unmatched_suppression(): - ret, stdout, stderr = cppcheck(['--inline-suppr', '--enable=information', '--error-exitcode=1', 'proj-inline-suppress']) + ret, stdout, stderr = cppcheck(['--inline-suppr', '--enable=information', '--error-exitcode=1', 'proj-inline-suppress/2.c']) assert ret == 1 assert 'Unmatched suppression: some_warning_id' in stderr