(tmpdir)
| 154 | |
| 155 | |
| 156 | def test_lib_lookup_ext_notfound(tmpdir): |
| 157 | test_file = os.path.join(tmpdir, 'test.c') |
| 158 | with open(test_file, 'wt'): |
| 159 | pass |
| 160 | |
| 161 | exitcode, stdout, stderr, exe = cppcheck_ex(['--debug-lookup=library', '--library=none.cfg', test_file]) |
| 162 | exepath = os.path.dirname(exe) |
| 163 | if sys.platform == 'win32': |
| 164 | exepath = exepath.replace('\\', '/') |
| 165 | assert exitcode == 1, stdout if stdout else stderr |
| 166 | lines = __remove_std_lookup_log(stdout.splitlines(), exepath) |
| 167 | assert lines == [ |
| 168 | "looking for library 'none.cfg'", |
| 169 | "looking for library '{}/none.cfg'".format(exepath), |
| 170 | "looking for library '{}/cfg/none.cfg'".format(exepath), |
| 171 | "library not found: 'none.cfg'", |
| 172 | "cppcheck: Failed to load library configuration file 'none.cfg'. File not found" |
| 173 | ] |
| 174 | |
| 175 | |
| 176 | def test_lib_lookup_relative_notfound(tmpdir): |
nothing calls this directly
no test coverage detected