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");