(tmpdir, addon_json, expected)
| 1533 | |
| 1534 | |
| 1535 | def __test_addon_json_invalid(tmpdir, addon_json, expected): |
| 1536 | addon_file = os.path.join(tmpdir, 'invalid.json') |
| 1537 | with open(addon_file, 'wt') as f: |
| 1538 | f.write(addon_json) |
| 1539 | |
| 1540 | test_file = os.path.join(tmpdir, 'file.cpp') |
| 1541 | with open(test_file, 'wt'): |
| 1542 | pass |
| 1543 | |
| 1544 | args = ['--addon={}'.format(addon_file), test_file] |
| 1545 | |
| 1546 | exitcode, stdout, stderr = cppcheck(args) |
| 1547 | assert exitcode == 1 |
| 1548 | lines = stdout.splitlines() |
| 1549 | assert len(lines) == 1 |
| 1550 | assert lines == [ |
| 1551 | 'Loading {} failed. {}'.format(addon_file, expected) |
| 1552 | ] |
| 1553 | assert stderr == '' |
| 1554 | |
| 1555 | |
| 1556 | def test_addon_json_invalid_no_obj(tmpdir): |
no test coverage detected