summaryrefslogtreecommitdiff
path: root/test/process.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 00:01:02 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit30a603341e3b23da6e5ab5995b060c8e4ec52242 (patch)
tree9a24941b147a5265e6b0726285e9501cd7b61c6d /test/process.zig
parentafc60e735274b0de5423ac375a9ea582f64b516f (diff)
downloadpardes-30a603341e3b23da6e5ab5995b060c8e4ec52242.tar.gz
pardes-30a603341e3b23da6e5ab5995b060c8e4ec52242.zip
test: the GPU move's gates, sharper: a window the harness starts runs under PARDES_TEST_WRAP when it names a command (perf stat, a script), given the window's argv, its binary made absolute; a test window's series keeps its frames as PAM (P7 RGB_ALPHA), so the corpus sees the alpha a blend writes (latest.ppm and every other capture stay RGB); the corpus adds a translucent addon picture, test/veil.zig (zig build veil: a GPU pass that clears to half alpha and draws nothing), for the addon pipeline's colour factor, which the snake's opaque picture never showed; the snake's window ends with its pane gone and at rest, so it ends having drawn as many frames every run
Diffstat (limited to 'test/process.zig')
-rw-r--r--test/process.zig22
1 files changed, 16 insertions, 6 deletions
diff --git a/test/process.zig b/test/process.zig
index 67d883ca..126a7924 100644
--- a/test/process.zig
+++ b/test/process.zig
@@ -616,12 +616,22 @@ pub const Detached = struct {
try std.fmt.bufPrintSentinel(&bufs[1], "--9p={s}", .{opts.socket orelse name}, 0)
else
try std.fmt.bufPrintSentinel(&bufs[1], "--detach={s}", .{name}, 0);
+ // PARDES_TEST_WRAP: a command a window runs under (`perf stat ...`,
+ // a script), given the window's own argv; the binary made absolute,
+ // as the child runs elsewhere.
+ const wrap = if (gui) std.c.getenv("PARDES_TEST_WRAP") else null;
+ var exe_buf: [4096]u8 = undefined;
var argv: [24][:0]const u8 = undefined;
- if (opts.args.len + 3 > argv.len) return error.TooManyArgs;
- argv[0] = exe;
- argv[1] = first;
- for (opts.args, 0..) |a, k| argv[2 + k] = a;
- argv[2 + opts.args.len] = fixture;
+ if (opts.args.len + 4 > argv.len) return error.TooManyArgs;
+ var at: usize = 0;
+ if (wrap) |w| {
+ argv[0] = std.mem.span(w);
+ at = 1;
+ }
+ argv[at] = if (wrap != null) std.mem.span(realpath(exe, &exe_buf) orelse return error.NoBinary) else exe;
+ argv[at + 1] = first;
+ for (opts.args, 0..) |a, k| argv[at + 2 + k] = a;
+ argv[at + 2 + opts.args.len] = fixture;
var grid_buf: [2][8]u8 = undefined;
var env: [16][2][:0]const u8 = undefined;
var n: usize = 0;
@@ -641,7 +651,7 @@ pub const Detached = struct {
env[n] = kv;
n += 1;
}
- d.child = try Child.spawn(argv[0 .. 3 + opts.args.len], .{
+ d.child = try Child.spawn(argv[0 .. at + 3 + opts.args.len], .{
.root = dir,
.env = env[0..n],
// A window runs on a terminal of its own, as one started from a