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

Function test_dummy_metrics_xml_report

test/cli/metrics_test.py:41–61  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

39 return path
40
41def test_dummy_metrics_xml_report(tmpdir):
42 output_file = os.path.join(tmpdir, "results.xml")
43 source_path = __create_source_file(tmpdir)
44 addon_path = __create_addon(tmpdir)
45 args = [
46 f'--output-file={output_file}',
47 f'--addon={addon_path}',
48 '--xml-version=3',
49 source_path
50 ]
51
52 ret, stdout, stderr = cppcheck(args)
53 assert ret == 0
54 assert stderr == ''
55 assert stdout == f'Checking {source_path} ...\n'
56
57 with open(output_file, 'r') as file:
58 xml = file.read()
59
60 for expected in __expected_xml:
61 assert xml.find(expected) >= 0
62
63def test_dummy_metrics_stdout(tmpdir):
64 source_path = __create_source_file(tmpdir)

Callers

nothing calls this directly

Calls 6

cppcheckFunction · 0.90
__create_source_fileFunction · 0.85
__create_addonFunction · 0.85
joinMethod · 0.45
readMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected