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

Function test_lib_lookup_relative_notfound

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

Source from the content-addressed store, hash-verified

174
175
176def test_lib_lookup_relative_notfound(tmpdir):
177 test_file = os.path.join(tmpdir, 'test.c')
178 with open(test_file, 'wt'):
179 pass
180
181 exitcode, stdout, stderr, exe = cppcheck_ex(['--debug-lookup=library', '--library=config/gnu.xml', test_file])
182 exepath = os.path.dirname(exe)
183 if sys.platform == 'win32':
184 exepath = exepath.replace('\\', '/')
185 assert exitcode == 1, stdout if stdout else stderr
186 lines = __remove_std_lookup_log(stdout.splitlines(), exepath)
187 assert lines == [
188 "looking for library 'config/gnu.xml'",
189 "looking for library '{}/config/gnu.xml'".format(exepath),
190 "looking for library '{}/cfg/config/gnu.xml'".format(exepath),
191 "library not found: 'config/gnu.xml'",
192 "cppcheck: Failed to load library configuration file 'config/gnu.xml'. File not found"
193 ]
194
195
196def test_lib_lookup_relative_noext_notfound(tmpdir):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected