(tmpdir)
| 34 | |
| 35 | |
| 36 | def __create_compdb(tmpdir): |
| 37 | file_name = 'test.c' |
| 38 | test_file = os.path.join(tmpdir, file_name) |
| 39 | with open(test_file, 'wt'): |
| 40 | pass |
| 41 | |
| 42 | compilation_db = [ |
| 43 | { |
| 44 | "directory": str(tmpdir), |
| 45 | "command": "c++ -o {}.o -c {}".format(os.path.basename(file_name), file_name), |
| 46 | "file": file_name, |
| 47 | "output": "{}.o".format(os.path.basename(file_name)) |
| 48 | } |
| 49 | ] |
| 50 | |
| 51 | compile_commands = os.path.join(tmpdir, 'compile_commands.json') |
| 52 | with open(compile_commands, 'wt') as f: |
| 53 | f.write(json.dumps(compilation_db)) |
| 54 | |
| 55 | return compile_commands, test_file |
| 56 | |
| 57 | |
| 58 | def test_lib_lookup(tmpdir): |
no test coverage detected