summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-03 16:17:51 -0300
committerGabriel Schneider <[email protected]>2026-11-03 16:21:16 -0300
commitd197289c331365081295cb44f27ee2893294cffa (patch)
treef4d64abdcdfcb714ece786fd050264dcc22a2bf5 /build.zig
parent86e9f8e241df16d96df542e08684af638c39fb89 (diff)
downloadpardes-d197289c331365081295cb44f27ee2893294cffa.tar.gz
pardes-d197289c331365081295cb44f27ee2893294cffa.zip
test: the behaviour-test step and test/session.zig, T1 of docs/next-tests.md: a Session drives the core as a 9P client does (walk by path, open, read or write, clunk, held lines run at the clunk as src/9p_io.zig runs them), the core opaque and the step's module importing session alone, so a behavioural test cannot reach past the 9P tree; keys (kbdin), click (on text found on /screen, mousein), screen, focused, refused and the refusal's words; test/behaviour/{other_files,panes,edit}.zig, a file a section of the reference: kbdin and mousein, a collapsed pane's ctl, name's leading blank, Putall, Edit blocks, moved out of src/ninep/ctl.zig (an Edit block left open now checked as a client sees it, an err in the log at its clunk), each checked to fail against a break (collapsed left off the ctl read, Putall saving nothing); the plan doc says the layout, the decisions and the progress
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
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