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

Function test_lib_lookup

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

Source from the content-addressed store, hash-verified

56
57
58def test_lib_lookup(tmpdir):
59 test_file = os.path.join(tmpdir, 'test.c')
60 with open(test_file, 'wt'):
61 pass
62
63 exitcode, stdout, stderr, exe = cppcheck_ex(['--debug-lookup=library', '--library=gnu', test_file])
64 exepath = os.path.dirname(exe)
65 if sys.platform == 'win32':
66 exepath = exepath.replace('\\', '/')
67 assert exitcode == 0, stdout if stdout else stderr
68 lines = __remove_std_lookup_log(stdout.splitlines(), exepath)
69 assert lines == [
70 "looking for library 'gnu.cfg'",
71 "looking for library '{}/gnu.cfg'".format(exepath),
72 "looking for library '{}/cfg/gnu.cfg'".format(exepath),
73 'Checking {} ...'.format(test_file)
74 ]
75
76
77def test_lib_lookup_ext(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