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

Function test_lib_lookup_absolute

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

Source from the content-addressed store, hash-verified

235
236
237def test_lib_lookup_absolute(tmpdir):
238 test_file = os.path.join(tmpdir, 'test.c')
239 with open(test_file, 'wt'):
240 pass
241
242 cfg_file = os.path.join(tmpdir, 'test.cfg')
243 with open(cfg_file, 'wt') as f:
244 f.write('''
245<?xml version="1.0"?>
246<def format="2">
247</def>
248 ''&#x27;)
249
250 exitcode, stdout, stderr, exe = cppcheck_ex(['--debug-lookup=library', '--library={}'.format(cfg_file), test_file])
251 exepath = os.path.dirname(exe)
252 if sys.platform == 'win32':
253 exepath = exepath.replace('\\', '/')
254 assert exitcode == 0, stdout if stdout else stderr
255 lines = __remove_std_lookup_log(stdout.splitlines(), exepath)
256 assert lines == [
257 "looking for library '{}'".format(cfg_file),
258 'Checking {} ...'.format(test_file)
259 ]
260
261
262def test_lib_lookup_absolute_notfound(tmpdir):

Callers

nothing calls this directly

Calls 6

cppcheck_exFunction · 0.90
__remove_std_lookup_logFunction · 0.85
formatMethod · 0.80
joinMethod · 0.45
writeMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected