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

Function __test_project_error

test/cli/project_test.py:20–30  ·  view source on GitHub ↗
(tmpdir, ext, content, expected)

Source from the content-addressed store, hash-verified

18
19
20def __test_project_error(tmpdir, ext, content, expected):
21 project_file = os.path.join(tmpdir, "file.{}".format(ext))
22
23 with open(project_file, 'w') as f:
24 if content is not None:
25 f.write(content)
26
27 ret, stdout, stderr = cppcheck(['--project=' + str(project_file)])
28 assert 1 == ret
29 assert "cppcheck: error: " + expected + "\ncppcheck: error: failed to load project '{}'. An error occurred.\n".format(project_file) == stdout
30 assert "" == stderr
31
32
33@pytest.mark.parametrize("project_ext, expected", [

Callers 13

test_empty_projectFunction · 0.85
test_json_no_argumentsFunction · 0.85
test_sln_invalid_fileFunction · 0.85
test_sln_no_headerFunction · 0.85
test_sln_no_projectsFunction · 0.85
test_slnx_no_xml_rootFunction · 0.85
test_slnx_no_projectsFunction · 0.85
test_vcxproj_no_xml_rootFunction · 0.85
test_bpr_no_xml_rootFunction · 0.85

Calls 5

cppcheckFunction · 0.90
strFunction · 0.85
formatMethod · 0.80
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected