Skip to content

Commit 87afedb

Browse files
committed
improve build_targets test
1 parent a60ad5f commit 87afedb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/benchmarks/build_targets/test.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,17 @@ function test_build(t)
6666
local meson = find_tool("meson")
6767
if meson then
6868
os.tryrm("build")
69-
local meson_dt = os.mclock()
69+
local meson_setup_dt = os.mclock()
7070
os.runv(meson.program, {"setup", "build"})
71+
meson_setup_dt = os.mclock() - meson_setup_dt
72+
73+
-- ccache will cache object files globally, which may affect the results of the second run.
74+
io.replace("build/build.ninja", "ccache", "")
75+
76+
local meson_build_dt = os.mclock()
7177
os.runv(meson.program, {"compile", "-C", "build"})
72-
meson_dt = os.mclock() - meson_dt
78+
meson_build_dt = os.mclock() - meson_build_dt
79+
local meson_dt = meson_setup_dt + meson_build_dt
7380
print("build targets/30: meson: %d ms", meson_dt)
7481
t:require((meson_dt > xmake_dt) or (meson_dt + 2000 > xmake_dt))
7582
end

0 commit comments

Comments
 (0)