(tmpdir)
| 174 | |
| 175 | |
| 176 | def test_lib_lookup_relative_notfound(tmpdir): |
| 177 | test_file = os.path.join(tmpdir, 'test.c') |
| 178 | with open(test_file, 'wt'): |
| 179 | pass |
| 180 | |
| 181 | exitcode, stdout, stderr, exe = cppcheck_ex(['--debug-lookup=library', '--library=config/gnu.xml', test_file]) |
| 182 | exepath = os.path.dirname(exe) |
| 183 | if sys.platform == 'win32': |
| 184 | exepath = exepath.replace('\\', '/') |
| 185 | assert exitcode == 1, stdout if stdout else stderr |
| 186 | lines = __remove_std_lookup_log(stdout.splitlines(), exepath) |
| 187 | assert lines == [ |
| 188 | "looking for library 'config/gnu.xml'", |
| 189 | "looking for library '{}/config/gnu.xml'".format(exepath), |
| 190 | "looking for library '{}/cfg/config/gnu.xml'".format(exepath), |
| 191 | "library not found: 'config/gnu.xml'", |
| 192 | "cppcheck: Failed to load library configuration file 'config/gnu.xml'. File not found" |
| 193 | ] |
| 194 | |
| 195 | |
| 196 | def test_lib_lookup_relative_noext_notfound(tmpdir): |
nothing calls this directly
no test coverage detected