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

Function test_lib_lookup_notfound

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

Source from the content-addressed store, hash-verified

94
95
96def test_lib_lookup_notfound(tmpdir):
97 test_file = os.path.join(tmpdir, 'test.c')
98 with open(test_file, 'wt'):
99 pass
100
101 exitcode, stdout, _, exe = cppcheck_ex(['--debug-lookup=library', '--library=none', test_file])
102 exepath = os.path.dirname(exe)
103 if sys.platform == 'win32':
104 exepath = exepath.replace('\\', '/')
105 assert exitcode == 1, stdout
106 lines = __remove_std_lookup_log(stdout.splitlines(), exepath)
107 assert lines == [
108 # TODO: specify which folder is actually used for lookup here
109 "looking for library 'none.cfg'",
110 "looking for library '{}/none.cfg'".format(exepath),
111 "looking for library '{}/cfg/none.cfg'".format(exepath),
112 "library not found: 'none'",
113 "cppcheck: Failed to load library configuration file 'none'. File not found"
114 ]
115
116
117def test_lib_lookup_notfound_project(tmpdir): # #13938

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