2019-05-01 11:54:13 +02:00
|
|
|
|
|
|
|
# python -m pytest test-suppress-syntaxError.py
|
|
|
|
|
|
|
|
from testutils import cppcheck
|
|
|
|
|
|
|
|
def test_j2():
|
2019-06-22 19:20:15 +02:00
|
|
|
ret, stdout, stderr = cppcheck(['--error-exitcode=1', '-j2', '-q', 'proj-suppress-syntaxError'])
|
2019-05-01 11:54:13 +02:00
|
|
|
assert ret == 1
|
|
|
|
assert len(stderr) > 0
|
|
|
|
|
|
|
|
def test_j2_suppress():
|
2019-06-22 19:20:15 +02:00
|
|
|
ret, stdout, stderr = cppcheck(['--error-exitcode=1', '--suppress=*:proj-suppress-syntaxError/*', '-j2', '-q', 'proj-suppress-syntaxError'])
|
2019-05-01 11:54:13 +02:00
|
|
|
assert ret == 0
|
|
|
|
assert len(stderr) == 0
|
|
|
|
|
2023-12-18 18:26:23 +01:00
|
|
|
def test_safety_suppress_syntax_error_implicitly(tmpdir):
|
2023-12-19 15:55:29 +01:00
|
|
|
ret, stdout, stderr = cppcheck(['--safety', '--suppress=*', 'proj-suppress-syntaxError'], remove_checkers_report=False)
|
2023-12-18 18:26:23 +01:00
|
|
|
assert ret == 1
|
|
|
|
assert '[syntaxError]' in stderr
|
2023-12-19 15:55:29 +01:00
|
|
|
assert 'Active checkers: There was critical errors' in stderr
|
2023-12-18 18:26:23 +01:00
|
|
|
|
|
|
|
def test_safety_suppress_syntax_error_explicitly():
|
2023-12-19 15:55:29 +01:00
|
|
|
ret, stdout, stderr = cppcheck(['--safety', '--suppress=syntaxError', 'proj-suppress-syntaxError'], remove_checkers_report=False)
|
2023-12-18 18:26:23 +01:00
|
|
|
assert ret == 1
|
|
|
|
assert '[syntaxError]' not in stderr
|
2023-12-19 15:55:29 +01:00
|
|
|
assert 'Active checkers: There was critical errors' in stderr
|
2023-12-18 18:26:23 +01:00
|
|
|
|