MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / test_misra_py

Function test_misra_py

test/cli/premium_test.py:116–131  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

114
115
116def test_misra_py(tmpdir):
117 # 13831 - do not execute misra.py when --premium=misra-c-2012 is used
118 test_file = os.path.join(tmpdir, 'test.c')
119 with open(test_file, 'wt') as f:
120 f.write('void foo();\n')
121
122 exe = __copy_cppcheck_premium(tmpdir)
123
124 # ensure that misra.py is not available:
125 _, stdout, _ = cppcheck(['--enable=style', '--addon=misra', test_file], cppcheck_exe=exe)
126 assert 'Did not find addon misra.py' in stdout
127
128 # Execute misra
129 _, stdout, _ = cppcheck(['--enable=style', '--premium=misra-c-2012', test_file], cppcheck_exe=exe)
130 assert 'misra.py' not in stdout # Did not find misra.py
131 assert 'Checking' in stdout
132
133
134def test_invalid_license_retry(tmpdir):

Callers

nothing calls this directly

Calls 4

cppcheckFunction · 0.90
__copy_cppcheck_premiumFunction · 0.85
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected