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

Function test_checkers_report

test/cli/helloworld_test.py:332–354  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

330
331
332def test_checkers_report(tmpdir):
333 filename = os.path.join(tmpdir, '1.txt')
334 args = [
335 f'--checkers-report={filename}',
336 '--no-cppcheck-build-dir', # TODO: remove this
337 'helloworld'
338 ]
339
340 cppcheck(args, cwd=__script_dir)
341
342 with open(filename, 'rt') as f:
343 data = f.read().splitlines()
344 assert 'No CheckAutoVariables::assignFunctionArg require:style,warning' in data, json.dumps(data, indent=4)
345 assert 'Yes CheckAutoVariables::autoVariables' in data, json.dumps(data, indent=4)
346
347 args += [
348 '--enable=style'
349 ]
350 cppcheck(args, cwd=__script_dir)
351 with open(filename, 'rt') as f:
352 data = f.read().splitlines()
353 # checker has been activated by --enable=style
354 assert 'Yes CheckAutoVariables::assignFunctionArg' in data, json.dumps(data, indent=4)
355
356
357def test_missing_include_system(): # #11283

Callers

nothing calls this directly

Calls 3

cppcheckFunction · 0.90
joinMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected