diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 56 |
1 files changed, 56 insertions, 0 deletions
@@ -1316,6 +1316,40 @@ pub fn build(b: *std.Build) void { run_image_harness.has_side_effects = true; b.step("image-harness", "exercise native Kitty/SDL image rendering end to end").dependOn(&run_image_harness.step); + // Kitty graphics through a terminal pane, end to end: a client in + // the pane's bash (and kitten icat, chafa when installed), a kitty + // terminal outside (tty) or the GPU capture (gui). test/kitty.zig + // is the same protocol at the core. + const kitty_client = b.addExecutable(.{ + .name = "pardes-kitty-client", + .root_module = b.createModule(.{ + .target = target, + .optimize = optimize, + .root_source_file = b.path("test/kitty_client.zig"), + .link_libc = true, + }), + }); + const kitty_harness = b.addExecutable(.{ + .name = "pardes-kitty-harness", + .root_module = b.createModule(.{ + .target = target, + .optimize = optimize, + .root_source_file = b.path("test/kitty_harness.zig"), + .link_libc = true, + }), + }); + if (ghostty_vt_for_snap) |vt| kitty_harness.root_module.addImport("ghostty-vt", vt); + switch (target.result.os.tag) { + .freebsd, .netbsd, .openbsd => kitty_harness.root_module.linkSystemLibrary("util", .{}), + else => {}, + } + const run_kitty_harness = b.addRunArtifact(kitty_harness); + run_kitty_harness.addArtifactArg(exe); + run_kitty_harness.addArtifactArg(kitty_client); + run_kitty_harness.addArg(if (platform == .gui) "gui" else "tty"); + run_kitty_harness.has_side_effects = true; + b.step("kitty-harness", "kitty graphics through a terminal pane end to end (a client inside, a kitty terminal or the GPU capture outside)").dependOn(&run_kitty_harness.step); + const pdf_harness_step = b.step("pdf-harness", "exercise continuous PDF rendering, search, and sections navigation end to end"); if (enable_mupdf) { const run_pdf_harness = b.addRunArtifact(image_harness); @@ -1694,6 +1728,28 @@ pub fn build(b: *std.Build) void { pane_test_step.dependOn(&run_pane_tests.step); if (testMatch(b, unit_profile, test_filters, pane_test_step)) |check| check.addArtifactArg(pane_tests); + // Kitty graphics conformance at the core: what a terminal pane's + // program sends, what it reads back, what ghostty stores and what a + // frame draws (test/kitty.zig). The end-to-end arm, through a real + // pty and the shell's output, is the kitty-harness step. + const kitty_module = b.createModule(.{ + .target = target, + .optimize = optimize, + .root_source_file = b.path("test/kitty.zig"), + .link_libc = true, + }); + kitty_module.addImport("pardes", core_module); + const kitty_tests = b.addTest(.{ .root_module = kitty_module, .filters = test_filters }); + if (test_nonce) |nonce| kitty_tests.root_module.addImport("test_rebuild_nonce", nonce); + test_build.dependOn(&kitty_tests.step); + const run_kitty_tests = b.addRunArtifact(kitty_tests); + run_kitty_tests.has_side_effects = true; + unit_step.dependOn(&run_kitty_tests.step); + if (unit_match) |check| check.addArtifactArg(kitty_tests); + const kitty_test_step = b.step("kitty-test", "run the kitty graphics conformance cases for terminal panes"); + kitty_test_step.dependOn(&run_kitty_tests.step); + if (testMatch(b, unit_profile, test_filters, kitty_test_step)) |check| check.addArtifactArg(kitty_tests); + // Keep native transport integration reachable even when the core's // anonymous test-import block is filtered out by Zig. const ninep_io_module = b.createModule(.{ |
