| 9 | |
| 10 | |
| 11 | def 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 | |
| 27 | def __test_language(tmp_path, file_ext, exp_lang, force_lang=None): |