summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig27
1 files changed, 27 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index 4485140d..8a9451eb 100644
--- a/build.zig
+++ b/build.zig
@@ -1864,6 +1864,33 @@ 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);
+ // The behavioural tests (docs/next-tests.md): their module has the
+ // session alone, so none can reach past what a 9P client sees.
+ const session_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ .root_source_file = b.path("test/session.zig"),
+ .link_libc = true,
+ });
+ session_module.addImport("pardes", core_module);
+ const behaviour_module = b.createModule(.{
+ .target = target,
+ .optimize = optimize,
+ .root_source_file = b.path("test/behaviour.zig"),
+ .link_libc = true,
+ });
+ behaviour_module.addImport("session", session_module);
+ const behaviour_tests = b.addTest(.{ .root_module = behaviour_module, .filters = test_filters });
+ if (test_nonce) |nonce| behaviour_tests.root_module.addImport("test_rebuild_nonce", nonce);
+ test_build.dependOn(&behaviour_tests.step);
+ const run_behaviour_tests = b.addRunArtifact(behaviour_tests);
+ run_behaviour_tests.has_side_effects = true;
+ unit_step.dependOn(&run_behaviour_tests.step);
+ if (unit_match) |check| check.addArtifactArg(behaviour_tests);
+ const behaviour_test_step = b.step("behaviour-test", "run the behavioural tests, through the 9P tree alone (test/behaviour/)");
+ behaviour_test_step.dependOn(&run_behaviour_tests.step);
+ if (testMatch(b, unit_profile, test_filters, behaviour_test_step)) |check| check.addArtifactArg(behaviour_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