| 35 | |
| 36 | |
| 37 | def 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 |