test: close long package reuse proofs
This commit is contained in:
@@ -124,6 +124,26 @@ fn runcommandenv(root: str, name: str, argv: []str, env: []str,
|
||||
out.stderr = readfile(c.stderrpath);
|
||||
};
|
||||
|
||||
fn runcommandenvdir(root: str, name: str, argv: []str, env: []str,
|
||||
dir: str, lifetime: time.duration, out: *commandout) void = {
|
||||
let c: exec.command;
|
||||
c.path = argv[0];
|
||||
c.argv = argv;
|
||||
c.env = env;
|
||||
c.dir = dir;
|
||||
c.stdoutpath = strings.concat(root, "/", name, ".stdout");
|
||||
c.stderrpath = strings.concat(root, "/", name, ".stderr");
|
||||
c.deadline = time.add(time.now(time.clock.monotonic), lifetime);
|
||||
c.grace = (100i64 * (time.millisecond: i64)): time.duration;
|
||||
let r: exec.result;
|
||||
exec.run(&c, &r);
|
||||
assert(r.errno == 0 && r.cleanuperrno == 0);
|
||||
out.termination = r.termination;
|
||||
out.code = r.code;
|
||||
out.stdout = readfile(c.stdoutpath);
|
||||
out.stderr = readfile(c.stderrpath);
|
||||
};
|
||||
|
||||
fn clean(root: str) void = {
|
||||
let av: []str = ["/bin/rm", "-rf", "--", root];
|
||||
let c: exec.command;
|
||||
@@ -703,6 +723,22 @@ fn mkdirall(path: str) void = {
|
||||
action, suffixes[xi]))));
|
||||
xi += 1;
|
||||
};
|
||||
let relative: str = strings.concat(".",
|
||||
strings.sub(real, root.len, real.len));
|
||||
let relativeav: []str = [driver(stages[si]), "test", "-w", work,
|
||||
relative];
|
||||
runcommandenvdir(root, strings.concat("relative-warm-", stages[si]),
|
||||
relativeav, env, root,
|
||||
(60i64 * (time.second: i64)): time.duration, &out);
|
||||
expectexit(&out, 0);
|
||||
assert(has(out.stdout, "real.value_is_one ... ok\n"));
|
||||
assert(same(coldtrace, readfile(trace)));
|
||||
xi = 0;
|
||||
for (xi < suffixes.len) {
|
||||
assert(same(references[xi], readfile(strings.concat(key, "/",
|
||||
action, suffixes[xi]))));
|
||||
xi += 1;
|
||||
};
|
||||
si += 1;
|
||||
};
|
||||
clean(root);
|
||||
@@ -3419,6 +3455,10 @@ fn mkdirall(path: str) void = {
|
||||
".unit.new>")) == 1);
|
||||
assert(has(readfile(strings.concat(work, artifacts[0], ".s")),
|
||||
strings.concat(commandid, ".value")));
|
||||
assert(has(readfile(strings.concat(work, artifacts[1], ".s")),
|
||||
strings.concat(commandid, ".command_internal")));
|
||||
assert(has(readfile(strings.concat(work, artifacts[2], ".s")),
|
||||
strings.concat(externalid, ".command_external")));
|
||||
let warmrefs: []str = alloc([], reference.len: u64)!;
|
||||
warmrefs.len = reference.len;
|
||||
ai = 0;
|
||||
|
||||
Reference in New Issue
Block a user