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

Function test_project_file_ignore

test/cli/more-projects_test.py:753–774  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

751 assert stderr == ''
752
753def test_project_file_ignore(tmpdir):
754 test_file = os.path.join(tmpdir, 'test.cpp')
755 with open(test_file, 'wt') as f:
756 pass
757
758 project_file = os.path.join(tmpdir, 'test.cppcheck')
759 with open(project_file, 'wt') as f:
760 f.write(
761 """<?xml version="1.0" encoding="UTF-8"?>
762<project>
763 <paths>
764 <dir name="{}"/>
765 </paths>
766</project>""".format(test_file))
767
768 args = ['-itest.cpp', '--project={}'.format(project_file)]
769 out_lines = [
770 'cppcheck: error: could not find or open any of the paths given.',
771 'cppcheck: Maybe all paths were ignored?'
772 ]
773
774 assert_cppcheck(args, ec_exp=1, err_exp=[], out_exp=out_lines)
775
776
777def test_project_file_ignore_2(tmpdir):

Callers

nothing calls this directly

Calls 4

assert_cppcheckFunction · 0.90
formatMethod · 0.80
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected