MCPcopy Create free account
hub / github.com/ccache/ccache / test_basic_compilation

Function test_basic_compilation

test/msvc/test_basic_functionality.py:1–20  ·  view source on GitHub ↗
(ccache_test)

Source from the content-addressed store, hash-verified

1def 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
23def test_define_change_is_miss(ccache_test):

Callers

nothing calls this directly

Calls 3

compileMethod · 0.80
existsMethod · 0.80
statsMethod · 0.45

Tested by

no test coverage detected