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

Function test_lib_lookup_absolute_notfound

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

Source from the content-addressed store, hash-verified

260
261
262def test_lib_lookup_absolute_notfound(tmpdir):
263 test_file = os.path.join(tmpdir, 'test.c')
264 with open(test_file, 'wt'):
265 pass
266
267 cfg_file = os.path.join(tmpdir, 'test.cfg')
268
269 exitcode, stdout, _, exe = cppcheck_ex(['--debug-lookup=library', '--library={}'.format(cfg_file), test_file])
270 exepath = os.path.dirname(exe)
271 if sys.platform == 'win32':
272 exepath = exepath.replace('\\', '/')
273 assert exitcode == 1, stdout
274 lines = __remove_std_lookup_log(stdout.splitlines(), exepath)
275 assert lines == [
276 "looking for library '{}'".format(cfg_file),
277 "library not found: '{}'".format(cfg_file),
278 "cppcheck: Failed to load library configuration file '{}'. File not found".format(cfg_file)
279 ]
280
281
282def test_lib_lookup_absolute_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