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

Function test_lib_lookup_ext_notfound

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

Source from the content-addressed store, hash-verified

154
155
156def test_lib_lookup_ext_notfound(tmpdir):
157 test_file = os.path.join(tmpdir, 'test.c')
158 with open(test_file, 'wt'):
159 pass
160
161 exitcode, stdout, stderr, exe = cppcheck_ex(['--debug-lookup=library', '--library=none.cfg', test_file])
162 exepath = os.path.dirname(exe)
163 if sys.platform == 'win32':
164 exepath = exepath.replace('\\', '/')
165 assert exitcode == 1, stdout if stdout else stderr
166 lines = __remove_std_lookup_log(stdout.splitlines(), exepath)
167 assert lines == [
168 "looking for library 'none.cfg'",
169 "looking for library '{}/none.cfg'".format(exepath),
170 "looking for library '{}/cfg/none.cfg'".format(exepath),
171 "library not found: 'none.cfg'",
172 "cppcheck: Failed to load library configuration file 'none.cfg'. File not found"
173 ]
174
175
176def test_lib_lookup_relative_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