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

Function test_lib_lookup_ext

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

Source from the content-addressed store, hash-verified

75
76
77def test_lib_lookup_ext(tmpdir):
78 test_file = os.path.join(tmpdir, 'test.c')
79 with open(test_file, 'wt'):
80 pass
81
82 exitcode, stdout, stderr, exe = cppcheck_ex(['--debug-lookup=library', '--library=gnu.cfg', test_file])
83 exepath = os.path.dirname(exe)
84 if sys.platform == 'win32':
85 exepath = exepath.replace('\\', '/')
86 assert exitcode == 0, stdout if stdout else stderr
87 lines = __remove_std_lookup_log(stdout.splitlines(), exepath)
88 assert lines == [
89 "looking for library 'gnu.cfg'",
90 "looking for library '{}/gnu.cfg'".format(exepath),
91 "looking for library '{}/cfg/gnu.cfg'".format(exepath),
92 'Checking {} ...'.format(test_file)
93 ]
94
95
96def test_lib_lookup_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