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

Function test_libraries

test/cli/dumpfile_test.py:11–24  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

9
10
11def test_libraries(tmpdir): #13701
12 test_file = str(tmpdir / 'test.c')
13 with open(test_file, 'wt') as f:
14 f.write('x=1;\n')
15
16 args = ['--library=posix', '--dump', test_file]
17 _, _, _ = cppcheck(args)
18
19 dumpfile = test_file + '.dump'
20 assert os.path.isfile(dumpfile)
21 with open(dumpfile, 'rt') as f:
22 dump = f.read()
23 assert '<library lib="posix"/>' in dump
24 assert dump.find('<library lib="posix"/>') < dump.find('<dump cfg=')
25
26
27def __test_language(tmp_path, file_ext, exp_lang, force_lang=None):

Callers

nothing calls this directly

Calls 5

cppcheckFunction · 0.90
strFunction · 0.85
writeMethod · 0.45
readMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected