(tmpdir)
| 235 | |
| 236 | |
| 237 | def 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 | ''') |
| 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 | |
| 262 | def test_lib_lookup_absolute_notfound(tmpdir): |
nothing calls this directly
no test coverage detected