(tmp_path)
| 112 | '[%s:4]: (style) misra violation (use --rule-texts=<file> to get proper output)\n' % (filename, filename)) |
| 113 | |
| 114 | def test_addon_with_gui_project(tmp_path): |
| 115 | shutil.copytree(os.path.join(__script_dir, 'helloworld'), tmp_path / 'helloworld') |
| 116 | project_file = os.path.join('helloworld', 'test.cppcheck') |
| 117 | create_gui_project_file(tmp_path / project_file, paths=['.'], addon='misra') |
| 118 | args = [ |
| 119 | '--template=cppcheck1', |
| 120 | '--enable=style', |
| 121 | '--project={}'.format(project_file) |
| 122 | ] |
| 123 | ret, stdout, stderr = cppcheck(args, cwd=tmp_path) |
| 124 | filename = os.path.join('helloworld', 'main.c') |
| 125 | assert ret == 0, stdout |
| 126 | assert stdout.strip().split('\n') == [ |
| 127 | 'Checking %s ...' % filename, |
| 128 | 'Checking %s: SOME_CONFIG=SOME_CONFIG...' % filename |
| 129 | ] |
| 130 | assert stderr == ('[%s:5]: (error) Division by zero.\n' |
| 131 | '[%s:4]: (style) misra violation (use --rule-texts=<file> to get proper output)\n' % (filename, filename)) |
| 132 | |
| 133 | def test_basepath_relative_path(): |
| 134 | args = [ |
nothing calls this directly
no test coverage detected