| 1 | def test_basic_compilation(ccache_test): |
| 2 | source = ccache_test.workdir / "test.c" |
| 3 | source.write_text("int main() {}\n") |
| 4 | |
| 5 | ccache_test.compile(["/c", "test.c", "/Fohello.obj"]) |
| 6 | stats_1 = ccache_test.stats() |
| 7 | assert stats_1["miss"] == 1 |
| 8 | assert stats_1["total_hit"] == 0 |
| 9 | |
| 10 | ccache_test.compile(["/c", "test.c", "/Fohello.obj"]) |
| 11 | stats_2 = ccache_test.stats() |
| 12 | assert stats_2["miss"] == 1 |
| 13 | assert stats_2["total_hit"] == 1 |
| 14 | assert (ccache_test.workdir / "hello.obj").exists() |
| 15 | |
| 16 | ccache_test.compile(["/c", "test.c"]) |
| 17 | stats_2 = ccache_test.stats() |
| 18 | assert stats_2["miss"] == 1 |
| 19 | assert stats_2["total_hit"] == 2 |
| 20 | assert (ccache_test.workdir / "test.obj").exists() |
| 21 | |
| 22 | |
| 23 | def test_define_change_is_miss(ccache_test): |