test: testenv.runcommandenv, the explicit-env runcommand variant
This commit is contained in:
@@ -97,10 +97,18 @@ export fn isdir(path: str) bool = {
|
|||||||
// failures abort; termination and exit code are the caller's verdict.
|
// failures abort; termination and exit code are the caller's verdict.
|
||||||
export fn runcommand(dir: str, root: str, name: str, argv: []str,
|
export fn runcommand(dir: str, root: str, name: str, argv: []str,
|
||||||
lifetime: time.duration, out: *commandout) void = {
|
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;
|
let c: exec.command;
|
||||||
c.path = argv[0];
|
c.path = argv[0];
|
||||||
c.argv = argv;
|
c.argv = argv;
|
||||||
c.env = os.getenvs();
|
c.env = env;
|
||||||
c.dir = dir;
|
c.dir = dir;
|
||||||
c.stdoutpath = strings.concat(root, "/", name, ".stdout");
|
c.stdoutpath = strings.concat(root, "/", name, ".stdout");
|
||||||
c.stderrpath = strings.concat(root, "/", name, ".stderr");
|
c.stderrpath = strings.concat(root, "/", name, ".stderr");
|
||||||
|
|||||||
Reference in New Issue
Block a user