test/cli: ensure that there is unmatchedSuppression warning

This commit is contained in:
Daniel Marjamäki 2019-08-17 17:49:22 +02:00
parent e24ce5b3ba
commit 1fdae247b3
2 changed files with 7 additions and 0 deletions

View File

@ -1,2 +1,5 @@
#include <1.h>
// cppcheck-suppress some_warning_id ; there should be a unmatchedSuppression warning about this
x;

View File

@ -15,3 +15,7 @@ def test2():
assert ret == 0
assert len(stderr) > 0
def test_unmatched_suppression():
ret, stdout, stderr = cppcheck(['--inline-suppr', '--enable=information', '--error-exitcode=1', 'proj-inline-suppress'])
assert ret == 1
assert 'Unmatched suppression: some_warning_id' in stderr