(f_create, text, output)
| 37 | |
| 38 | |
| 39 | def _compile(f_create, text, output): |
| 40 | with tempfile.TemporaryDirectory() as temp_dir: |
| 41 | src_path = os.path.join(temp_dir, "src.cpp") |
| 42 | with open(src_path, "w", encoding="utf-8") as file: |
| 43 | file.write(_src_gen(text)) |
| 44 | log_path = os.path.join(temp_dir, "log.txt") |
| 45 | ccache_env = { |
| 46 | "CCACHE_COMPILERCHECK": "content", |
| 47 | "CCACHE_LOGFILE": log_path, |
| 48 | } |
| 49 | f_create(output, ["src.cpp"], ["-c"], cwd=temp_dir, ccache_env=ccache_env) |
| 50 | with open(log_path, encoding="utf-8") as file: |
| 51 | log = file.read() |
| 52 | return log |
| 53 | |
| 54 | |
| 55 | @pytest.mark.skipif(shutil.which("ccache") is None, reason="ccache not installed") |
no test coverage detected
searching dependent graphs…