(tmpdir, ext, content, expected)
| 18 | |
| 19 | |
| 20 | def __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", [ |
no test coverage detected