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

Function test_lib_lookup_notfound_project

test/cli/lookup_test.py:117–134  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

115
116
117def test_lib_lookup_notfound_project(tmpdir): # #13938
118 project_file, _ = __create_gui_project(tmpdir)
119
120 exitcode, stdout, _, exe = cppcheck_ex(['--debug-lookup=library', '--library=none', '--project={}'.format(project_file)])
121 exepath = os.path.dirname(exe)
122 if sys.platform == 'win32':
123 exepath = exepath.replace('\\', '/')
124 assert exitcode == 1, stdout
125 lines = __remove_std_lookup_log(stdout.splitlines(), exepath)
126 assert lines == [
127 # TODO: needs to look relative to the project first
128 # TODO: specify which folder is actually used for lookup here
129 "looking for library 'none.cfg'",
130 "looking for library '{}/none.cfg'".format(exepath),
131 "looking for library '{}/cfg/none.cfg'".format(exepath),
132 "library not found: 'none'",
133 "cppcheck: Failed to load library configuration file 'none'. File not found"
134 ]
135
136
137def test_lib_lookup_notfound_compdb(tmpdir):

Callers

nothing calls this directly

Calls 5

cppcheck_exFunction · 0.90
__create_gui_projectFunction · 0.85
__remove_std_lookup_logFunction · 0.85
formatMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected