summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 03:56:36 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit34641e435fcbae0af578189760d5ebb05bc07f9a (patch)
tree52957c9fe379df12199b605e68786077d66a68d6 /src/ninep
parent79a1e816ceb13ef81b712007716c8add2de75434 (diff)
downloadpardes-34641e435fcbae0af578189760d5ebb05bc07f9a.tar.gz
pardes-34641e435fcbae0af578189760d5ebb05bc07f9a.zip
Term: a core without a terminal boots to a scratch pane, and a test skips only where it needs a terminal (docs/next-terminal.md, Phase 1, the no-terminal core): Pardes.init's shell boots (.shell, .classic, .tty, .tty_shell) are one scratch pane when Term.ops is null, so a test that booted a shell for convenience runs on it, where every one of them skipped before (Term.open refused with SkipZigTest under a test); Term.open refuses with error.NoTerminal, said by errorWords as Term.none, so Term and an exec no shell can take (a command pane) refuse in words (`Term: no terminal in this build`, `exec: ...`), and takesCommandLine is false with no terminal pane; a +Pager pages the bytes as they are (Term.page, unchanged); no boot message: the no-terminal core is a test build alone, read by no person, and a message at boot put seven core tests (the message log, the notice bands, the Del question's wake, a press on a column's rule) out of core-test; a test that fails for want of a terminal says so on its first line (`if (pardes.Term.ops == null) return error.SkipZigTest; // a shell`: a shell, a command pane, the classic boot's three shells, it reads the emulator, ...), 99 tests in 25 files, and ninep/testing.zig's withTerm, the fixture of 29 that assert a terminal pane, once; each attributed by its failure on the scratch boot (NoTerminal from newShell or newCommand, a shell's pane, prompt, pty bytes or tag asserted, the classic boot's panes indexed) and by reading its body; no assertion changes; test: Term.zig ends with the no-terminal core's three (each boot a scratch pane and no terminal; Term, newShell and an exec refused in words, no line typed at a shell; a program's output paged as plain text); core-test (no terminal) 411 passed / 535 skipped of 946 to 810 passed / 139 skipped of 949, shell-test 992: 989 passed, the three no-terminal tests skipped
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/cols.zig4
-rw-r--r--src/ninep/ctl.zig9
-rw-r--r--src/ninep/events.zig1
-rw-r--r--src/ninep/pane.zig3
-rw-r--r--src/ninep/testing.zig1
-rw-r--r--src/ninep/tree.zig1
6 files changed, 19 insertions, 0 deletions
diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig
index c8d84e5d..d953bcc7 100644
--- a/src/ninep/cols.zig
+++ b/src/ninep/cols.zig
@@ -435,6 +435,7 @@ test "Help and Find at /tagexec act in the session's directory, not the keyboard
}
test "a shell command at /tagexec or a column's exec is a command pane in the session's directory, never typed into the keyboard's terminal" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try Pardes.init(testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 30 });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -455,6 +456,7 @@ test "a shell command at /tagexec or a column's exec is a command pane in the se
}
test "New and Term run at /tagexec and a column's exec, with no pane at all too" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try th.withFile(testing.allocator, "x\n");
defer p.deinit();
const tagexec = @backingInt(tree.TopFile.tagexec);
@@ -671,6 +673,7 @@ test "tagexec runs a word as a click in the workspace tag; exec files read back
}
test "a word run from the workspace's or a column's tag runs in the session's directory, a pane's in its own" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try th.withFile(testing.allocator, "x\n");
defer p.deinit();
const session = p.sessionDir();
@@ -689,6 +692,7 @@ test "a word run from the workspace's or a column's tag runs in the session's di
}
test "a command run from a column's tag gets its pane in that column, not the last" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try th.withFile(testing.allocator, "x\n");
defer p.deinit();
layout.newColumn(p, p.view().active);
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index f717fc26..49fe661d 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -1879,6 +1879,7 @@ test "Mount dials its peer and fails, mounting nothing, when none answers; a loo
}
test "Term in a directory that is not there fails and makes no pane; a shell that never started answers a run" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
const serial = serialOf(p);
@@ -1971,6 +1972,7 @@ test "a script's Grep and Find fill the pane's one query pane, a row a line unde
}
test "a terminal told the directory it already goes by logs no rename" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
_ = wr(p, Node.of(serialOf(p), .name), "/tmp/f.txt\n");
@@ -2019,6 +2021,7 @@ test "a terminal with text typed at its prompt is never typed into: a look at it
}
test "a command line from a missing directory fails ENOENT and makes no pane; a command whose shell never started ends 127" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
p.host = .{ .vtable = &th.starting };
@@ -2178,6 +2181,7 @@ test "a failure said while a 9P write waits on it posts no msg, only the write's
}
test "with no pane at all, the root look opens its file and the root exec runs in the session's directory" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
var tmp = testing.tmpDir(.{});
@@ -2238,6 +2242,7 @@ test "a restored pane whose file is gone from disk comes back dirty, and Del ask
test "a focus moved over 9P tells the programs that asked for focus reports, as a click does" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(testing.allocator, .{ .cols = 90, .rows = 30, .shells = 2 });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -2366,6 +2371,7 @@ test "/recent shows a name as /index does, a newline in it escaped" {
}
test "size is monotonic: growing is never refused, and a size once taken is taken again" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(testing.allocator, .{ .tty_only = true, .cols = 160, .rows = 60 });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -2602,6 +2608,7 @@ test "@p<terminal>:<address> takes any address over the terminal's lines, select
}
test "what a /pager open writes after its directory is the text: plain in the body, its colours the pane's, clean, in by the read" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the emulator's parse of colours
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
const pager = @backingInt(tree.TopFile.pager);
@@ -2670,6 +2677,7 @@ test "what a /pager open writes after its directory is the text: plain in the bo
}
test "a command pane an exec open was answered is leased to it while it stays open: another client's command gets a pane of its own" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
const exec = Node.of(serialOf(p), .exec);
@@ -2717,6 +2725,7 @@ test "a body write to an image pane says its body takes none, not that terminals
}
test "Term+bash on a pane ctl is Term with its argument, as exec and the tag take it" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
// Tty+sh too: Term's old name, as a saved tag holds it.
diff --git a/src/ninep/events.zig b/src/ninep/events.zig
index 5b5378b1..9e6df93d 100644
--- a/src/ninep/events.zig
+++ b/src/ninep/events.zig
@@ -1306,6 +1306,7 @@ test "after a Restore a new pane or column takes a serial past every one the old
}
test "a pane named before it is announced has its new under that name, and no rename before it" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try withFile(testing.allocator, "one\n");
defer p.deinit();
const pane = p.panes[0].?;
diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig
index 6c86053f..93759aa5 100644
--- a/src/ninep/pane.zig
+++ b/src/ninep/pane.zig
@@ -1056,6 +1056,7 @@ test "rows through the line index are the ones counting newlines gives, at every
}
test "a terminal's body stats as long as it reads" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = testing.allocator;
const p = try pardes.Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
@@ -1070,6 +1071,7 @@ test "a terminal's body stats as long as it reads" {
}
test "a body write to a terminal pane types at its shell" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 10 });
defer p.deinit();
@@ -1280,6 +1282,7 @@ test "a limit write that fails keeps the limit a truncation cleared before it" {
}
test "index names a command's pane cmd, a shell's term" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
try testing.expectEqual(Status.ok, wr(p, Node.of(serialOf(p), .exec), "true\n").reply.status);
diff --git a/src/ninep/testing.zig b/src/ninep/testing.zig
index 14aeffea..a9f6d5de 100644
--- a/src/ninep/testing.zig
+++ b/src/ninep/testing.zig
@@ -114,6 +114,7 @@ pub fn withFile(gpa: std.mem.Allocator, text: []const u8) !*Pardes {
}
pub fn withTerm(gpa: std.mem.Allocator) !*Pardes {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24 });
errdefer p.deinit();
while (p.nextEffect()) |_| {}
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig
index e5e521c3..73468ef8 100644
--- a/src/ninep/tree.zig
+++ b/src/ninep/tree.zig
@@ -2146,6 +2146,7 @@ test "a write with no newline waits for its newline or the close, whatever its s
}
test "look and exec read back what their own open's write touched; a fresh open reads the session's last" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell, by Term
const p = try th.withFile(testing.allocator, "x\n");
defer p.deinit();
const exec = @backingInt(TopFile.exec);