# python -m pytest dumpfile_test.py import json import os import pathlib from testutils import cppcheck import xml.etree.ElementTree as ET def test_libraries(tmpdir): #13701 test_file = str(tmpdir / 'test.c') with open(test_file, 'wt') as f: f.write('x=1;\n') args = ['--library=posix', '--dump', test_file] _, _, _ = cppcheck(args) dumpfile = test_file + '.dump' assert os.path.isfile(dumpfile) with open(dumpfile, 'rt') as f: dump = f.read() assert '' in dump assert dump.find('') < dump.find('' in dump