From 23db361612168b7473c41323caa1c25cccfe71bf Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Sat, 8 Aug 2026 14:35:21 +0900 Subject: [PATCH] test: testenv.runcommandenv, the explicit-env runcommand variant --- test/testenv/testenv.ww | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/testenv/testenv.ww b/test/testenv/testenv.ww index 22e59425..c92dc543 100644 --- a/test/testenv/testenv.ww +++ b/test/testenv/testenv.ww @@ -97,10 +97,18 @@ export fn isdir(path: str) bool = { // failures abort; termination and exit code are the caller's verdict. export fn runcommand(dir: str, root: str, name: str, argv: []str, lifetime: time.duration, out: *commandout) void = { + runcommandenv(dir, root, name, argv, os.getenvs(), lifetime, out); +}; + +// Explicit-env variant of [[runcommand]] for arranger observers that +// must control the child's environment per row (exec.command.env is +// caller-built; ww ships no setenv primitive, deliberately). +export fn runcommandenv(dir: str, root: str, name: str, argv: []str, + env: []str, lifetime: time.duration, out: *commandout) void = { let c: exec.command; c.path = argv[0]; c.argv = argv; - c.env = os.getenvs(); + c.env = env; c.dir = dir; c.stdoutpath = strings.concat(root, "/", name, ".stdout"); c.stderrpath = strings.concat(root, "/", name, ".stderr");