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

Function test_lib_lookup_notfound_compdb

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

Source from the content-addressed store, hash-verified

135
136
137def test_lib_lookup_notfound_compdb(tmpdir):
138 compdb_file, _ = __create_compdb(tmpdir)
139
140 exitcode, stdout, _, exe = cppcheck_ex(['--debug-lookup=library', '--library=none', '--project={}'.format(compdb_file)])
141 exepath = os.path.dirname(exe)
142 if sys.platform == 'win32':
143 exepath = exepath.replace('\\', '/')
144 assert exitcode == 1, stdout
145 lines = __remove_std_lookup_log(stdout.splitlines(), exepath)
146 assert lines == [
147 # TODO: specify which folder is actually used for lookup here
148 "looking for library 'none.cfg'",
149 "looking for library '{}/none.cfg'".format(exepath),
150 "looking for library '{}/cfg/none.cfg'".format(exepath),
151 "library not found: 'none'",
152 "cppcheck: Failed to load library configuration file 'none'. File not found"
153 ]
154
155
156def test_lib_lookup_ext_notfound(tmpdir):

Callers

nothing calls this directly

Calls 5

cppcheck_exFunction · 0.90
__remove_std_lookup_logFunction · 0.85
formatMethod · 0.80
__create_compdbFunction · 0.70
replaceMethod · 0.45

Tested by

no test coverage detected