diff --git a/test/cli/proj-inline-suppress/1.c b/test/cli/proj-inline-suppress/1.c new file mode 100644 index 000000000..484aeee6d --- /dev/null +++ b/test/cli/proj-inline-suppress/1.c @@ -0,0 +1,2 @@ +#include <1.h> + diff --git a/test/cli/proj-inline-suppress/1.h b/test/cli/proj-inline-suppress/1.h new file mode 100644 index 000000000..9ca29fb80 --- /dev/null +++ b/test/cli/proj-inline-suppress/1.h @@ -0,0 +1,5 @@ + +// cppcheck-suppress zerodiv +const int x = 10000 / 0; + + diff --git a/test/cli/test-inline-suppress.py b/test/cli/test-inline-suppress.py new file mode 100644 index 000000000..090ef1199 --- /dev/null +++ b/test/cli/test-inline-suppress.py @@ -0,0 +1,17 @@ + +# python -m pytest test-inline-suppress.py + +import os +import re +from testutils import cppcheck + +def test1(): + ret, stdout, stderr = cppcheck('--inline-suppr proj-inline-suppress') + assert ret == 0 + assert len(stderr) == 0 + +def test2(): + ret, stdout, stderr = cppcheck('proj-inline-suppress') + assert ret == 0 + assert len(stderr) > 0 +