diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 14:06:55 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 14:06:55 -0300 |
| commit | 20f75e147d720a6a4c98c4c3b4db067bbf55ee32 (patch) | |
| tree | 0b1be6ea0fe02c118b8fc896797ffd9d87cce0a8 /build/tools.zig | |
| parent | 5246fc74f3cb7d317e96654ce9aab72bd50495f0 (diff) | |
| download | pardes-20f75e147d720a6a4c98c4c3b4db067bbf55ee32.tar.gz pardes-20f75e147d720a6a4c98c4c3b4db067bbf55ee32.zip | |
build: each test root one call (Units.root)
tests.zig's test roots are made by one helper, Units.root: a test
program over a path with its imports, at the build's target and
optimization, filtered by -Dtest-filter. kitty-test, behaviour-test,
the protocol roots (a table before, straight-line calls now), the deck
replay, and the perf and fs bench programs' own tests (made in tools.zig
before, which hands tests.zig perf.zig's options now) are each a line.
pane-test keeps three lines after its call: ghostty-vt is optional while
ghostty is unfetched, and the import order is the compile's cache key.
Gates: zig build -l and -h byte-identical, whole matrix; the printed
configuration byte-identical for every shape but gui's, whose diff is
module, owner and contents indices only (renumbering); a warm rebuild on
the base's cache, install addons then core-test shell-test unit-test
process-test on tui and gui: 0 compiles not cached (tui 117 cached 518
reused, gui 125 cached 540 reused), the same test counts as the base
(tui 2339/2486, gui 2398/2545; the base's 4 addon ABI failures and tui's
lspcomplete pair), installed pardes, pardes-gui, image.so and pdf.so
cmp-identical to the base's.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'build/tools.zig')
| -rw-r--r-- | build/tools.zig | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/build/tools.zig b/build/tools.zig index 4393e088..bcf073ef 100644 --- a/build/tools.zig +++ b/build/tools.zig @@ -15,8 +15,8 @@ pub fn program(b: *std.Build, name: []const u8, root: []const u8, target: std.Bu /// What unit-test runs of what these make. pub const Tools = struct { perf_gate_step: *std.Build.Step, - perf_tests: *std.Build.Step.Compile, - fs_bench_test: *std.Build.Step.Compile, + /// The perf program's build identity, which its own tests read too. + perf_options: *std.Build.Step.Options, lib_test_step: *std.Build.Step, }; @@ -229,16 +229,6 @@ pub fn add(b: *std.Build, c: struct { perf_gate.addArgs(&.{ "--only", "medium", "--reps", "10", "--base", b.fmt("test/perf-baseline-{t}-{t}.json", .{ c.platform, c.optimize }), "--max-ratio", "3" }); const perf_gate_step = b.step("perf-gate", "fail when a gesture on the 50k-line file takes over 3x its recorded baseline (test/perf-baseline-<platform>-<optimize>.json)"); perf_gate_step.dependOn(&perf_gate.step); - const perf_tests = b.addTest(.{ - .root_module = b.createModule(.{ - .target = c.target, - .optimize = c.optimize, - .root_source_file = b.path("test/perf.zig"), - .link_libc = true, - }), - .filters = c.test_filters, - }); - perf_tests.root_module.addOptions("perf_options", perf_options); const fs_bench = program(b, "pardes-fs-bench", "test/fs_bench.zig", c.target, .fast, &.{.{ .name = "pardes", .module = c.core_module }}); const run_fs_bench = b.addRunArtifact(fs_bench); @@ -247,14 +237,6 @@ pub fn add(b: *std.Build, c: struct { run_fs_bench.setCwd(b.path(".")); const fs_bench_step = b.step("fs-bench", "9P filesystem request cost and allocation count (-- [--json] [--reps N])"); fs_bench_step.dependOn(&run_fs_bench.step); - const fs_bench_test = b.addTest(.{ - .root_module = b.createModule(.{ - .target = c.target, - .optimize = c.optimize, - .root_source_file = b.path("test/fs_bench.zig"), - }), - .filters = c.test_filters, - }); // The syntax module's own tests and snapshots, on the core without // a terminal: its tests reach the editor's modes (modal.zig). @@ -297,7 +279,7 @@ pub fn add(b: *std.Build, c: struct { run_history.addPassthruArgs(); run_history.has_side_effects = true; b.step("history", "compare command output and test/build runtime across jj revisions").dependOn(&run_history.step); - return .{ .perf_gate_step = perf_gate_step, .perf_tests = perf_tests, .fs_bench_test = fs_bench_test, .lib_test_step = lib_test_step }; + return .{ .perf_gate_step = perf_gate_step, .perf_options = perf_options, .lib_test_step = lib_test_step }; } /// The PDF benches: the core over the pdf addon, a pane of it. |
