test: close long package reuse proofs
This commit is contained in:
@@ -3458,10 +3458,13 @@ keeps these values separately:
|
|||||||
- `storage`: an internal scratch basename that is never passed as package
|
- `storage`: an internal scratch basename that is never passed as package
|
||||||
identity.
|
identity.
|
||||||
|
|
||||||
The first four values, not `storage`, participate in directory-action
|
`canon` participates in command-local directory-action interning, diagnostics,
|
||||||
interning, source-import edges, module-reset ownership, compiler `--import`
|
and storage-address derivation. The complete `path`, together with the
|
||||||
arguments, export ownership, diagnostics, generated-main construction, and
|
semantic `variant` and `role`, is the persisted/compiler owner carried through
|
||||||
symbol qualification. The reversible outside-root form remains
|
source-import edges, module-reset and export ownership, compiler `--import`
|
||||||
|
arguments, generated-main construction, and symbol qualification; `storage`
|
||||||
|
participates in none of those identities. The reversible outside-root form
|
||||||
|
remains
|
||||||
`__wwlocal.p<escaped-canonical-absolute-directory>.<declared-leaf>` and is
|
`__wwlocal.p<escaped-canonical-absolute-directory>.<declared-leaf>` and is
|
||||||
allocated to its exact length. It is neither truncated nor replaced by a
|
allocated to its exact length. It is neither truncated nor replaced by a
|
||||||
digest, and `__wwlocal` remains unavailable to source imports. Package
|
digest, and `__wwlocal` remains unavailable to source imports. Package
|
||||||
|
|||||||
@@ -124,6 +124,26 @@ fn runcommandenv(root: str, name: str, argv: []str, env: []str,
|
|||||||
out.stderr = readfile(c.stderrpath);
|
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 = {
|
fn clean(root: str) void = {
|
||||||
let av: []str = ["/bin/rm", "-rf", "--", root];
|
let av: []str = ["/bin/rm", "-rf", "--", root];
|
||||||
let c: exec.command;
|
let c: exec.command;
|
||||||
@@ -703,6 +723,22 @@ fn mkdirall(path: str) void = {
|
|||||||
action, suffixes[xi]))));
|
action, suffixes[xi]))));
|
||||||
xi += 1;
|
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;
|
si += 1;
|
||||||
};
|
};
|
||||||
clean(root);
|
clean(root);
|
||||||
@@ -3419,6 +3455,10 @@ fn mkdirall(path: str) void = {
|
|||||||
".unit.new>")) == 1);
|
".unit.new>")) == 1);
|
||||||
assert(has(readfile(strings.concat(work, artifacts[0], ".s")),
|
assert(has(readfile(strings.concat(work, artifacts[0], ".s")),
|
||||||
strings.concat(commandid, ".value")));
|
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)!;
|
let warmrefs: []str = alloc([], reference.len: u64)!;
|
||||||
warmrefs.len = reference.len;
|
warmrefs.len = reference.len;
|
||||||
ai = 0;
|
ai = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user