(tmpdir)
| 751 | assert stderr == '' |
| 752 | |
| 753 | def 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 | |
| 777 | def test_project_file_ignore_2(tmpdir): |
nothing calls this directly
no test coverage detected