summaryrefslogtreecommitdiff
path: root/test/kitty.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-29 12:32:23 -0300
committerGabriel Schneider <[email protected]>2026-10-29 13:11:16 -0300
commit7e6834ba5eff5c0e61891ec1935e5e0ca8291c2f (patch)
treeb64162d23d96aea1cff55cdb1899c026d9522ec1 /test/kitty.zig
parent6b89fed454fd56a3af4b576646538b45d3315146 (diff)
downloadpardes-7e6834ba5eff5c0e61891ec1935e5e0ca8291c2f.tar.gz
pardes-7e6834ba5eff5c0e61891ec1935e5e0ca8291c2f.zip
tests on FreeBSD: Linux's /proc/1 fixtures, the builtins lists, daemon.py and fs.py without /proc
- The refusing directory some tests name is Linux's /proc/1/root: that part skips elsewhere. The committed builtins-*.json are Linux builds' (Tty9p): their check skips, and a key the docs give a word this build leaves out is found in the other's list. - kitty: a shared memory object is sized before it is written (FreeBSD's write does not grow it); a FIFO in /dev/shm is Linux's case. - daemon.py asks ps and procstat where there is no /proc, and finds bash on PATH. fs.py runs printenv once a name, and skips two permission checks as root, who searches and writes anywhere. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/kitty.zig')
-rw-r--r--test/kitty.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/kitty.zig b/test/kitty.zig
index de4dd605..07e89cf9 100644
--- a/test/kitty.zig
+++ b/test/kitty.zig
@@ -299,6 +299,8 @@ test "kitty: file, temporary-file and shared-memory media load, and the terminal
const fd = shm.shm_open(name, @bitCast(std.c.O{ .ACCMODE = .RDWR, .CREAT = true, .TRUNC = true }), 0o600);
if (fd < 0) return error.ShmOpenFailed;
defer _ = shm.shm_unlink(name);
+ // Sized first: FreeBSD's write does not grow a shared memory object.
+ if (ftruncate(fd, rgb_raw.len) != 0) return error.WriteFailed;
if (std.c.write(fd, &rgb_raw, rgb_raw.len) != rgb_raw.len) return error.WriteFailed;
_ = std.c.close(fd);
r.feed(0, try std.fmt.allocPrint(arena, "\x1b_Ga=t,t=s,i=43,f=24,s=4,v=2,S={d};{s}\x1b\\", .{ rgb_raw.len, try b64(arena, name) }));
@@ -847,6 +849,8 @@ test "kitty: a FIFO named by t=f, t=t or t=s never blocks pardes" {
.{ .medium = 's', .fifo = shm_path, .name = shm_path["/dev/shm".len..] },
};
for (cases) |c| {
+ // Shared memory is a directory only on Linux (/dev/shm).
+ if (c.medium == 's' and comptime @import("builtin").os.tag != .linux) continue;
_ = std.c.unlink(c.fifo);
if (mkfifo(c.fifo, 0o600) != 0) return error.MkfifoFailed;
defer _ = std.c.unlink(c.fifo);