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

Function test_json_out

addons/test/misra_test.py:84–94  ·  view source on GitHub ↗
(checker, capsys, test_files)

Source from the content-addressed store, hash-verified

82
83
84def test_json_out(checker, capsys, test_files):
85 sys.argv.append("--cli")
86 checker.loadRuleTexts("./addons/test/misra/misra_rules_dummy.txt")
87 checker.parseDump("./addons/test/misra/misra-test.c.dump")
88 captured = capsys.readouterr()
89 captured = captured.out.splitlines()
90 sys.argv.remove("--cli")
91 json_output = convert_json_output(captured)
92 assert("Mandatory" in json_output['c2012-10.4'][0]['extra'])
93 assert("Required" in json_output['c2012-21.3'][0]['extra'])
94 assert("Advisory" in json_output['c2012-20.1'][0]['extra'])
95
96
97def test_rules_cppcheck_severity(checker, capsys, test_files):

Callers

nothing calls this directly

Calls 3

convert_json_outputFunction · 0.85
loadRuleTextsMethod · 0.80
parseDumpMethod · 0.80

Tested by

no test coverage detected