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

Function test_block

test/cli/inline-suppress-polyspace_test.py:36–48  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

34
35
36def test_block(tmp_path):
37 test_file = tmp_path / 'test.c'
38 with open(test_file, 'wt') as f:
39 f.write('/* polyspace +1 MISRA2012:8.2 */\n'
40 'int f();\n' # <- suppression applies to this line
41 'int g();\n') # <- suppression does not apply to this line
42
43 args = ['--addon=misra', '--template=simple', '--enable=style,information', '--inline-suppr', 'test.c']
44
45 out_exp = ['Checking test.c ...']
46 err_exp = ['test.c:3:6: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-8.2]']
47
48 assert_cppcheck(args, ec_exp=0, err_exp=err_exp, out_exp=out_exp, cwd=str(tmp_path))
49
50
51def test_begin_end(tmp_path):

Callers

nothing calls this directly

Calls 3

assert_cppcheckFunction · 0.90
strFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected