diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 46 |
1 files changed, 21 insertions, 25 deletions
@@ -1,7 +1,7 @@ const std = @import("std"); const builtin = @import("builtin"); const mupdf_build = @import("mupdf.zig"); -const snap_build = @import("build/snap.zig"); +const process_build = @import("build/process.zig"); const grammar_manifest = @import("src/grammar_manifest.zig"); /// The package manifest, imported UNTYPED on purpose — see the `version` /// option in `shellOptions` for why that word is load-bearing. @@ -760,13 +760,13 @@ pub fn build(b: *std.Build) void { vaxis_mod.root_source_file = files.getDirectory().path(b, "main.zig"); } - var ghostty_vt_for_snap: ?*std.Build.Module = null; + var ghostty_vt_for_tests: ?*std.Build.Module = null; const ghostty_simd = !target.result.os.tag.isDarwin() or b.graph.host.result.os.tag.isDarwin(); const ghostty_optimize: std.lang.Optimize = if (optimize == .debug) .safe else optimize; const ghostty_dep = b.lazyDependency("ghostty", .{ .target = target, .optimize = ghostty_optimize, .simd = ghostty_simd, .@"app-runtime" = .none, .@"emit-xcframework" = false }); if (ghostty_dep) |dep| { const ghostty_vt = dep.module("ghostty-vt"); - ghostty_vt_for_snap = ghostty_vt; + ghostty_vt_for_tests = ghostty_vt; ghostty_vt.addImport("uucode", uucode_mod); patchGhosttyKitty(b, io, dep, ghostty_vt); ghostty_core_vt = ghostty_vt; @@ -1221,12 +1221,12 @@ pub fn build(b: *std.Build) void { } const addons: []const *std.Build.Step.Compile = if (pdf_addon) |l| b.allocator.dupe(*std.Build.Step.Compile, &.{ image_addon, l }) catch @panic("OOM") else &.{image_addon}; - snap_build.addTty(b, .{ + process_build.add(b, .{ .exe = exe, .addons = addons, .target = target, .optimize = optimize, - .ghostty_vt = ghostty_vt_for_snap, + .ghostty_vt = ghostty_vt_for_tests, .cloud9 = cloud9, .gui = platform == .gui, }); @@ -1240,7 +1240,7 @@ pub fn build(b: *std.Build) void { .link_libc = true, }), }); - if (ghostty_vt_for_snap) |vt| image_harness.root_module.addImport("ghostty-vt", vt); + if (ghostty_vt_for_tests) |vt| image_harness.root_module.addImport("ghostty-vt", vt); switch (target.result.os.tag) { .freebsd, .netbsd, .openbsd => image_harness.root_module.linkSystemLibrary("util", .{}), else => {}, @@ -1274,7 +1274,7 @@ pub fn build(b: *std.Build) void { .link_libc = true, }), }); - if (ghostty_vt_for_snap) |vt| kitty_harness.root_module.addImport("ghostty-vt", vt); + if (ghostty_vt_for_tests) |vt| kitty_harness.root_module.addImport("ghostty-vt", vt); switch (target.result.os.tag) { .freebsd, .netbsd, .openbsd => kitty_harness.root_module.linkSystemLibrary("util", .{}), else => {}, @@ -1428,7 +1428,7 @@ pub fn build(b: *std.Build) void { }); perf.root_module.addImport("pardes", core_module); // --live drives the real binary through a pty (test/e2e_harness.zig). - if (ghostty_vt_for_snap) |vt| perf.root_module.addImport("ghostty-vt", vt); + if (ghostty_vt_for_tests) |vt| perf.root_module.addImport("ghostty-vt", vt); perf.root_module.addOptions("perf_options", perf_options); const run_perf = b.addRunArtifact(perf); run_perf.has_side_effects = true; @@ -1588,7 +1588,7 @@ pub fn build(b: *std.Build) void { }); session_module.addImport("pardes", core_module); // The scripted language server its language words ask - // (Session.initLanguage), as the snapshot scripts' do. + // (Session.initLanguage), as the tty cases do. const session_options = b.addOptions(); session_options.addOptionPath("lspmock", b.addExecutable(.{ .name = "pardes-lspmock", @@ -1632,7 +1632,7 @@ pub fn build(b: *std.Build) void { // window's word knows which build it runs in. behaviour_module.addImport("pardes_config", core_module.import_table.get("pardes_config").?); const behaviour_tests = b.addTest(.{ .root_module = behaviour_module, .filters = test_filters }); - const behaviour_test_step = b.step("behaviour-test", "run the behavioural tests, through the 9P tree alone (test/behaviour/)"); + const behaviour_test_step = b.step("behaviour-test", "run the behavioural tests, through the 9P tree alone (test/behaviour/), and the T1 runner (-- [--seed N]... | --monkey <seeds> | --replay)"); _ = units.add(b, behaviour_tests, behaviour_test_step); // An addon's own test: `--addon-test` over the fake (the template) // and the snake (a shipped example, built but not installed), each @@ -1659,10 +1659,12 @@ pub fn build(b: *std.Build) void { addon_test_step.dependOn(&compare.step); if (lib == pdf_addon) mupdf_check.dependOn(&compare.step); }; - // The 9P monkey at T1 (test/monkey9p.zig): random requests against - // an in-process session, the documented rules checked after each. - // Its fixed-seed smoke run is part of behaviour-test. - const monkey_session = b.addExecutable(.{ + // The T1 runner (test/monkey9p.zig): its modes over an in-process + // session, random 9P requests with the documented rules checked + // after each, random input hunting panics (`-- --monkey <seeds>`), + // and its seeds' tapes replayed (`-- --replay`). Bare, a short + // fixed-seed run of the first, part of behaviour-test. + const t1_runner = b.addExecutable(.{ .name = "pardes-monkey-session", .root_module = b.createModule(.{ .target = target, @@ -1671,17 +1673,11 @@ pub fn build(b: *std.Build) void { .link_libc = true, }), }); - monkey_session.root_module.addImport("session", session_module); - const run_monkey_session = b.addRunArtifact(monkey_session); - run_monkey_session.addPassthruArgs(); - run_monkey_session.has_side_effects = true; - b.step("monkey-session", "random 9P requests against an in-process session, checking the documented rules (-- [--seed N]... [--steps M] [--only i,j,k] [--no-shrink] [-v])").dependOn(&run_monkey_session.step); - const run_monkey_session_smoke = b.addRunArtifact(monkey_session); - run_monkey_session_smoke.addArg("--smoke"); - run_monkey_session_smoke.has_side_effects = true; - const monkey_session_smoke_step = b.step("monkey-session-smoke", "a short fixed-seed run of monkey-session (part of behaviour-test)"); - monkey_session_smoke_step.dependOn(&run_monkey_session_smoke.step); - if (test_filters.len == 0) behaviour_test_step.dependOn(&run_monkey_session_smoke.step); + t1_runner.root_module.addImport("session", session_module); + const run_t1_runner = b.addRunArtifact(t1_runner); + run_t1_runner.addPassthruArgs(); + run_t1_runner.has_side_effects = true; + if (test_filters.len == 0) behaviour_test_step.dependOn(&run_t1_runner.step); // Kitty graphics conformance at the core: what a terminal pane's // program sends, what it reads back, what ghostty stores and what a |
