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

Function test_basedir_normalizes_paths

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

Source from the content-addressed store, hash-verified

35
36
37def test_basedir_normalizes_paths(ccache_test):
38 ccache_test.env["CCACHE_NOHASHDIR"] = "1"
39 ccache_test.env["CCACHE_BASEDIR"] = str(ccache_test.workdir)
40
41 dirs = []
42 for name in ["dir1", "dir2"]:
43 d = ccache_test.workdir / name
44 d.mkdir()
45 (d / "test.c").write_text("int x;\n")
46 dirs.append(d)
47
48 ccache_test.compile(["/c", "test.c"], cwd=dirs[0])
49 stats_1 = ccache_test.stats()
50 assert stats_1["miss"] == 1
51
52 ccache_test.compile(["/c", "test.c"], cwd=dirs[1])
53 stats_2 = ccache_test.stats()
54 assert stats_2["miss"] == 1
55 assert stats_2["total_hit"] == 1

Callers

nothing calls this directly

Calls 2

compileMethod · 0.80
statsMethod · 0.45

Tested by

no test coverage detected