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

Function test_addon_with_gui_project

test/cli/helloworld_test.py:114–131  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

112 '[%s:4]: (style) misra violation (use --rule-texts=<file> to get proper output)\n' % (filename, filename))
113
114def 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
133def test_basepath_relative_path():
134 args = [

Callers

nothing calls this directly

Calls 4

create_gui_project_fileFunction · 0.90
cppcheckFunction · 0.90
formatMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected