test: follow canonical directory root artifacts
This commit is contained in:
@@ -100,11 +100,11 @@ fn samefile(a: str, b: str, why: str) void = {
|
|||||||
let wantroot: str = strings.concat("//ww:module-reset main\n", appsrc,
|
let wantroot: str = strings.concat("//ww:module-reset main\n", appsrc,
|
||||||
"\n");
|
"\n");
|
||||||
if (!testenv.same(wantroot, testenv.readfile(strings.concat(cwork,
|
if (!testenv.same(wantroot, testenv.readfile(strings.concat(cwork,
|
||||||
"__root.unit.ww")))) {
|
"main.unit.ww")))) {
|
||||||
fail("root unit is not exactly its owned source");
|
fail("root unit is not exactly its owned source");
|
||||||
};
|
};
|
||||||
let keys: []str = ["example.base", "example.bar", "example.foo",
|
let keys: []str = ["example.base", "example.bar", "example.foo",
|
||||||
"__root"];
|
"main"];
|
||||||
let suffixes: []str = [".unit.ww", ".wwi", ".a"];
|
let suffixes: []str = [".unit.ww", ".wwi", ".a"];
|
||||||
i = 0;
|
i = 0;
|
||||||
for (i < keys.len) {
|
for (i < keys.len) {
|
||||||
|
|||||||
@@ -289,8 +289,8 @@ fn rejectstable(dir: str, label: str, target: str, needle: str) void = {
|
|||||||
let expectedunit: str = strings.concat("//ww:module-reset main\n",
|
let expectedunit: str = strings.concat("//ww:module-reset main\n",
|
||||||
mainsrc, "\n");
|
mainsrc, "\n");
|
||||||
if (!testenv.same(expectedunit, testenv.readfile(strings.concat(cwork,
|
if (!testenv.same(expectedunit, testenv.readfile(strings.concat(cwork,
|
||||||
"__root.unit.ww"))) || !testenv.same(expectedunit,
|
"main.unit.ww"))) || !testenv.same(expectedunit,
|
||||||
testenv.readfile(strings.concat(wwork, "__root.unit.ww")))) {
|
testenv.readfile(strings.concat(wwork, "main.unit.ww")))) {
|
||||||
fail("self-contained", "consumer unit was not exactly its owned source");
|
fail("self-contained", "consumer unit was not exactly its owned source");
|
||||||
};
|
};
|
||||||
if (!testenv.exists(strings.concat(cwork, "implementation.a"))
|
if (!testenv.exists(strings.concat(cwork, "implementation.a"))
|
||||||
@@ -404,7 +404,7 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
fail("diamond", "shared package was not interned exactly once");
|
fail("diamond", "shared package was not interned exactly once");
|
||||||
};
|
};
|
||||||
let unit: str = testenv.readfile(strings.concat(scratch,
|
let unit: str = testenv.readfile(strings.concat(scratch,
|
||||||
"__root.unit.ww"));
|
"main.unit.ww"));
|
||||||
let rootbody: str = testenv.readfile(strings.concat(main, "/main.ww"));
|
let rootbody: str = testenv.readfile(strings.concat(main, "/main.ww"));
|
||||||
let wantroot: str = strings.concat("//ww:module-reset main\n", rootbody,
|
let wantroot: str = strings.concat("//ww:module-reset main\n", rootbody,
|
||||||
"\n");
|
"\n");
|
||||||
@@ -446,8 +446,8 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
let firstscratch: str = strings.concat(firstout, ".sepwork/");
|
let firstscratch: str = strings.concat(firstout, ".sepwork/");
|
||||||
let shuffledscratch: str = strings.concat(shuffledout, ".sepwork/");
|
let shuffledscratch: str = strings.concat(shuffledout, ".sepwork/");
|
||||||
if (!testenv.same(testenv.readfile(strings.concat(firstscratch,
|
if (!testenv.same(testenv.readfile(strings.concat(firstscratch,
|
||||||
"__root.unit.ww")), testenv.readfile(strings.concat(shuffledscratch,
|
"main.unit.ww")), testenv.readfile(strings.concat(shuffledscratch,
|
||||||
"__root.unit.ww"))) || !testenv.same(testenv.readfile(strings.concat(
|
"main.unit.ww"))) || !testenv.same(testenv.readfile(strings.concat(
|
||||||
firstscratch, "shared.unit.ww")), testenv.readfile(strings.concat(
|
firstscratch, "shared.unit.ww")), testenv.readfile(strings.concat(
|
||||||
shuffledscratch, "shared.unit.ww")))) {
|
shuffledscratch, "shared.unit.ww")))) {
|
||||||
fail("diamond", "shuffled enumeration changed package units");
|
fail("diamond", "shuffled enumeration changed package units");
|
||||||
@@ -567,7 +567,7 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let rootunit: str = testenv.readfile(strings.concat(work,
|
let rootunit: str = testenv.readfile(strings.concat(work,
|
||||||
"__root.unit.ww"));
|
"main.unit.ww"));
|
||||||
let depunit: str = testenv.readfile(strings.concat(work,
|
let depunit: str = testenv.readfile(strings.concat(work,
|
||||||
"dep.unit.ww"));
|
"dep.unit.ww"));
|
||||||
if (!testenv.has(rootunit, "//ww:module-reset main\npackage main;")
|
if (!testenv.has(rootunit, "//ww:module-reset main\npackage main;")
|
||||||
@@ -580,9 +580,9 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
|| !testenv.exists(strings.concat(work, "leaf.a"))
|
|| !testenv.exists(strings.concat(work, "leaf.a"))
|
||||||
|| !testenv.exists(strings.concat(work, "dep.wwi"))
|
|| !testenv.exists(strings.concat(work, "dep.wwi"))
|
||||||
|| !testenv.exists(strings.concat(work, "dep.a"))
|
|| !testenv.exists(strings.concat(work, "dep.a"))
|
||||||
|| !testenv.exists(strings.concat(work, "__root.o"))
|
|| !testenv.exists(strings.concat(work, "main.o"))
|
||||||
|| !testenv.exists(strings.concat(work, "__root.wwi"))
|
|| !testenv.exists(strings.concat(work, "main.wwi"))
|
||||||
|| !testenv.exists(strings.concat(work, "__root.a"))) {
|
|| !testenv.exists(strings.concat(work, "main.a"))) {
|
||||||
fail("library-roots", "package artifacts do not match root ownership");
|
fail("library-roots", "package artifacts do not match root ownership");
|
||||||
};
|
};
|
||||||
let ctrace: str = testenv.readfile(compilertrace);
|
let ctrace: str = testenv.readfile(compilertrace);
|
||||||
@@ -593,13 +593,13 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
|| testenv.occurrences(ctrace, strings.concat("<", work,
|
|| testenv.occurrences(ctrace, strings.concat("<", work,
|
||||||
"dep.unit.ww>")) != 1
|
"dep.unit.ww>")) != 1
|
||||||
|| testenv.occurrences(ctrace, strings.concat("<", work,
|
|| testenv.occurrences(ctrace, strings.concat("<", work,
|
||||||
"__root.unit.ww>")) != 1
|
"main.unit.ww>")) != 1
|
||||||
|| testenv.pos(ctrace, strings.concat("<", work,
|
|| testenv.pos(ctrace, strings.concat("<", work,
|
||||||
"leaf.unit.ww>")) >= testenv.pos(ctrace, strings.concat("<",
|
"leaf.unit.ww>")) >= testenv.pos(ctrace, strings.concat("<",
|
||||||
work, "dep.unit.ww>"))
|
work, "dep.unit.ww>"))
|
||||||
|| testenv.pos(ctrace, strings.concat("<", work,
|
|| testenv.pos(ctrace, strings.concat("<", work,
|
||||||
"dep.unit.ww>")) >= testenv.pos(ctrace, strings.concat("<",
|
"dep.unit.ww>")) >= testenv.pos(ctrace, strings.concat("<",
|
||||||
work, "__root.unit.ww>"))) {
|
work, "main.unit.ww>"))) {
|
||||||
fail("library-roots", "compiler actions were not deterministic postorder");
|
fail("library-roots", "compiler actions were not deterministic postorder");
|
||||||
};
|
};
|
||||||
if (!testenv.has(ctrace, strings.concat(
|
if (!testenv.has(ctrace, strings.concat(
|
||||||
@@ -608,8 +608,8 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
"dep.s><", work, "dep.unit.ww>"))
|
"dep.s><", work, "dep.unit.ww>"))
|
||||||
|| !testenv.has(ctrace, strings.concat(
|
|| !testenv.has(ctrace, strings.concat(
|
||||||
"BEGIN<--entry><-c><--import><dep><", work,
|
"BEGIN<--entry><-c><--import><dep><", work,
|
||||||
"dep.wwi><-I><", work, "__root.wwi><-o><", work,
|
"dep.wwi><-I><", work, "main.wwi><-o><", work,
|
||||||
"__root.s><", work, "__root.unit.ww>"))
|
"main.s><", work, "main.unit.ww>"))
|
||||||
|| testenv.occurrences(atrace, "\n") != 3
|
|| testenv.occurrences(atrace, "\n") != 3
|
||||||
|| !testenv.has(atrace, strings.concat("BEGIN<-o><", work,
|
|| !testenv.has(atrace, strings.concat("BEGIN<-o><", work,
|
||||||
"dep.o><", work, "dep.s>"))) {
|
"dep.o><", work, "dep.s>"))) {
|
||||||
@@ -617,7 +617,7 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
};
|
};
|
||||||
if (testenv.occurrences(ltrace, "\n") != 1
|
if (testenv.occurrences(ltrace, "\n") != 1
|
||||||
|| !testenv.has(ltrace, strings.concat("BEGIN<-o><", bin, "><",
|
|| !testenv.has(ltrace, strings.concat("BEGIN<-o><", bin, "><",
|
||||||
work, "__root.a>"))
|
work, "main.a>"))
|
||||||
|| testenv.pos(ltrace, strings.concat("<", work, "dep.a>")) < 0
|
|| testenv.pos(ltrace, strings.concat("<", work, "dep.a>")) < 0
|
||||||
|| testenv.pos(ltrace, strings.concat("<", work, "leaf.a>"))
|
|| testenv.pos(ltrace, strings.concat("<", work, "leaf.a>"))
|
||||||
< testenv.pos(ltrace, strings.concat("<", work, "dep.a>"))
|
< testenv.pos(ltrace, strings.concat("<", work, "dep.a>"))
|
||||||
@@ -651,9 +651,9 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
referencearchive = strings.dup(testenv.readfile(strings.concat(work,
|
referencearchive = strings.dup(testenv.readfile(strings.concat(work,
|
||||||
"dep.a")));
|
"dep.a")));
|
||||||
referencerootwwi = strings.dup(testenv.readfile(strings.concat(work,
|
referencerootwwi = strings.dup(testenv.readfile(strings.concat(work,
|
||||||
"__root.wwi")));
|
"main.wwi")));
|
||||||
referencerootarchive = strings.dup(testenv.readfile(strings.concat(work,
|
referencerootarchive = strings.dup(testenv.readfile(strings.concat(work,
|
||||||
"__root.a")));
|
"main.a")));
|
||||||
referencebin = strings.dup(testenv.readfile(bin));
|
referencebin = strings.dup(testenv.readfile(bin));
|
||||||
referencecompiler = strings.dup(ctrace);
|
referencecompiler = strings.dup(ctrace);
|
||||||
referenceassembler = strings.dup(atrace);
|
referenceassembler = strings.dup(atrace);
|
||||||
@@ -665,9 +665,9 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
|| !testenv.same(referencearchive, testenv.readfile(strings.concat(
|
|| !testenv.same(referencearchive, testenv.readfile(strings.concat(
|
||||||
work, "dep.a")))
|
work, "dep.a")))
|
||||||
|| !testenv.same(referencerootwwi,
|
|| !testenv.same(referencerootwwi,
|
||||||
testenv.readfile(strings.concat(work, "__root.wwi")))
|
testenv.readfile(strings.concat(work, "main.wwi")))
|
||||||
|| !testenv.same(referencerootarchive,
|
|| !testenv.same(referencerootarchive,
|
||||||
testenv.readfile(strings.concat(work, "__root.a")))
|
testenv.readfile(strings.concat(work, "main.a")))
|
||||||
|| !testenv.same(referencebin, testenv.readfile(bin))
|
|| !testenv.same(referencebin, testenv.readfile(bin))
|
||||||
|| !testenv.same(referencecompiler, ctrace)
|
|| !testenv.same(referencecompiler, ctrace)
|
||||||
|| !testenv.same(referenceassembler, atrace)
|
|| !testenv.same(referenceassembler, atrace)
|
||||||
@@ -727,7 +727,7 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
testenv.runcommandenv(cwd, td, strings.concat("empty-library-",
|
testenv.runcommandenv(cwd, td, strings.concat("empty-library-",
|
||||||
tags[si]), av, emptyenv, tmo(), &out);
|
tags[si]), av, emptyenv, tmo(), &out);
|
||||||
let rootunit: str = testenv.readfile(strings.concat(emptywork,
|
let rootunit: str = testenv.readfile(strings.concat(emptywork,
|
||||||
"__root.unit.ww"));
|
"main.unit.ww"));
|
||||||
let ctrace: str = testenv.readfile(compilertrace);
|
let ctrace: str = testenv.readfile(compilertrace);
|
||||||
let atrace: str = testenv.readfile(assemblertrace);
|
let atrace: str = testenv.readfile(assemblertrace);
|
||||||
let ltrace: str = testenv.readfile(linkertrace);
|
let ltrace: str = testenv.readfile(linkertrace);
|
||||||
@@ -881,7 +881,7 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
" cold build failed: ", out.stderr));
|
" cold build failed: ", out.stderr));
|
||||||
};
|
};
|
||||||
|
|
||||||
let rootunitpath: str = strings.concat(work, "/__root.unit.ww");
|
let rootunitpath: str = strings.concat(work, "/main.unit.ww");
|
||||||
let depunitpath: str = strings.concat(work, "/dep.unit.ww");
|
let depunitpath: str = strings.concat(work, "/dep.unit.ww");
|
||||||
let rootunit: str = testenv.readfile(rootunitpath);
|
let rootunit: str = testenv.readfile(rootunitpath);
|
||||||
let depunit: str = testenv.readfile(depunitpath);
|
let depunit: str = testenv.readfile(depunitpath);
|
||||||
@@ -895,8 +895,8 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
|| !testenv.exists(strings.concat(work, "/leaf.a"))
|
|| !testenv.exists(strings.concat(work, "/leaf.a"))
|
||||||
|| !testenv.exists(strings.concat(work, "/dep.wwi"))
|
|| !testenv.exists(strings.concat(work, "/dep.wwi"))
|
||||||
|| !testenv.exists(strings.concat(work, "/dep.a"))
|
|| !testenv.exists(strings.concat(work, "/dep.a"))
|
||||||
|| !testenv.exists(strings.concat(work, "/__root.wwi"))
|
|| !testenv.exists(strings.concat(work, "/main.wwi"))
|
||||||
|| !testenv.exists(strings.concat(work, "/__root.a"))
|
|| !testenv.exists(strings.concat(work, "/main.a"))
|
||||||
|| !testenv.same(testenv.readfile(strings.concat(work,
|
|| !testenv.same(testenv.readfile(strings.concat(work,
|
||||||
"/.wwtool.ww")), testenv.readfile(copied[si]))
|
"/.wwtool.ww")), testenv.readfile(copied[si]))
|
||||||
|| !testenv.same(testenv.readfile(strings.concat(work,
|
|| !testenv.same(testenv.readfile(strings.concat(work,
|
||||||
@@ -921,9 +921,9 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
"/dep.s.new><", work, "/dep.unit.new>"))
|
"/dep.s.new><", work, "/dep.unit.new>"))
|
||||||
|| !testenv.has(coldcompiler, strings.concat(
|
|| !testenv.has(coldcompiler, strings.concat(
|
||||||
"BEGIN<--entry><-c><--import><dep><", work,
|
"BEGIN<--entry><-c><--import><dep><", work,
|
||||||
"/dep.wwi><-I><", work, "/__root.wwi.new><-o><", work,
|
"/dep.wwi><-I><", work, "/main.wwi.new><-o><", work,
|
||||||
"/__root.s.new><", work,
|
"/main.s.new><", work,
|
||||||
"/__root.unit.new>"))
|
"/main.unit.new>"))
|
||||||
|| testenv.occurrences(coldassembler, "\n") != 3
|
|| testenv.occurrences(coldassembler, "\n") != 3
|
||||||
|| !testenv.has(coldassembler, strings.concat(
|
|| !testenv.has(coldassembler, strings.concat(
|
||||||
"BEGIN<-o><", work, "/dep.o.new><", work,
|
"BEGIN<-o><", work, "/dep.o.new><", work,
|
||||||
@@ -932,7 +932,7 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
};
|
};
|
||||||
if (testenv.occurrences(coldlinker, "\n") != 1
|
if (testenv.occurrences(coldlinker, "\n") != 1
|
||||||
|| !testenv.has(coldlinker, strings.concat("BEGIN<-o><", bin,
|
|| !testenv.has(coldlinker, strings.concat("BEGIN<-o><", bin,
|
||||||
"><", work, "/__root.a>"))
|
"><", work, "/main.a>"))
|
||||||
|| testenv.pos(coldlinker, strings.concat("<", work,
|
|| testenv.pos(coldlinker, strings.concat("<", work,
|
||||||
"/dep.a>")) < 0
|
"/dep.a>")) < 0
|
||||||
|| testenv.pos(coldlinker, strings.concat("<", work,
|
|| testenv.pos(coldlinker, strings.concat("<", work,
|
||||||
@@ -965,7 +965,7 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
|| testenv.occurrences(changedexportcompiler, strings.concat("<", work,
|
|| testenv.occurrences(changedexportcompiler, strings.concat("<", work,
|
||||||
"/dep.unit.new>")) != 2
|
"/dep.unit.new>")) != 2
|
||||||
|| testenv.occurrences(changedexportcompiler, strings.concat("<", work,
|
|| testenv.occurrences(changedexportcompiler, strings.concat("<", work,
|
||||||
"/__root.unit.new>")) != 1
|
"/main.unit.new>")) != 1
|
||||||
|| testenv.occurrences(changedexportcompiler, "\n") != 5
|
|| testenv.occurrences(changedexportcompiler, "\n") != 5
|
||||||
|| testenv.occurrences(changedexportassembler, "\n") != 5) {
|
|| testenv.occurrences(changedexportassembler, "\n") != 5) {
|
||||||
fail("driver-identity", "changed export did not stop at an unchanged importer export");
|
fail("driver-identity", "changed export did not stop at an unchanged importer export");
|
||||||
@@ -999,7 +999,7 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
|| testenv.occurrences(testenv.readfile(compilertrace), strings.concat(
|
|| testenv.occurrences(testenv.readfile(compilertrace), strings.concat(
|
||||||
"<", work, "/dep.unit.new>")) != 3
|
"<", work, "/dep.unit.new>")) != 3
|
||||||
|| testenv.occurrences(testenv.readfile(compilertrace), strings.concat(
|
|| testenv.occurrences(testenv.readfile(compilertrace), strings.concat(
|
||||||
"<", work, "/__root.unit.new>")) != 1
|
"<", work, "/main.unit.new>")) != 1
|
||||||
|| testenv.occurrences(testenv.readfile(compilertrace), "\n") != 7
|
|| testenv.occurrences(testenv.readfile(compilertrace), "\n") != 7
|
||||||
|| testenv.occurrences(testenv.readfile(assemblertrace), "\n") != 7
|
|| testenv.occurrences(testenv.readfile(assemblertrace), "\n") != 7
|
||||||
|| !testenv.same(coldbin, testenv.readfile(bin))) {
|
|| !testenv.same(coldbin, testenv.readfile(bin))) {
|
||||||
@@ -1024,7 +1024,7 @@ fn writediamond(td: str, reverse: bool) str = {
|
|||||||
|| testenv.occurrences(changedcompiler, strings.concat("<", work,
|
|| testenv.occurrences(changedcompiler, strings.concat("<", work,
|
||||||
"/dep.unit.new>")) != 4
|
"/dep.unit.new>")) != 4
|
||||||
|| testenv.occurrences(changedcompiler, strings.concat("<", work,
|
|| testenv.occurrences(changedcompiler, strings.concat("<", work,
|
||||||
"/__root.unit.new>")) != 2
|
"/main.unit.new>")) != 2
|
||||||
|| testenv.occurrences(changedcompiler, "\n") != 10
|
|| testenv.occurrences(changedcompiler, "\n") != 10
|
||||||
|| testenv.occurrences(changedassembler, "\n") != 10
|
|| testenv.occurrences(changedassembler, "\n") != 10
|
||||||
|| testenv.occurrences(changedlinker, "\n") != 5) {
|
|| testenv.occurrences(changedlinker, "\n") != 5) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ package direnum_test;
|
|||||||
//
|
//
|
||||||
// rootorder — a private rootok/ dir built DIRECTLY (z.ww ORDER-Z
|
// rootorder — a private rootok/ dir built DIRECTLY (z.ww ORDER-Z
|
||||||
// value()=17 vs a.ww ORDER-A leading comment + main): build exit 0,
|
// value()=17 vs a.ww ORDER-A leading comment + main): build exit 0,
|
||||||
// the binary exits 17, and the driver's <out>.sepwork/__root.unit.ww
|
// the binary exits 17, and the driver's <out>.sepwork/rootok.unit.ww
|
||||||
// stores ORDER-A strictly before ORDER-Z (byte-sorted deterministic
|
// stores ORDER-A strictly before ORDER-Z (byte-sorted deterministic
|
||||||
// source order); the two stages' units are byte-identical.
|
// source order); the two stages' units are byte-identical.
|
||||||
//
|
//
|
||||||
@@ -143,7 +143,7 @@ fn rejectpair(label: str, td: str, target: str, needle: str) void = {
|
|||||||
fail("rootorder", strings.concat(drvs[s], " exit != 17"));
|
fail("rootorder", strings.concat(drvs[s], " exit != 17"));
|
||||||
};
|
};
|
||||||
units[s] = testenv.readfile(strings.concat(out,
|
units[s] = testenv.readfile(strings.concat(out,
|
||||||
".sepwork/__root.unit.ww"));
|
".sepwork/rootok.unit.ww"));
|
||||||
let a: i32 = testenv.pos(units[s], "ORDER-A");
|
let a: i32 = testenv.pos(units[s], "ORDER-A");
|
||||||
let z: i32 = testenv.pos(units[s], "ORDER-Z");
|
let z: i32 = testenv.pos(units[s], "ORDER-Z");
|
||||||
if (a < 0 || z < 0 || a >= z) {
|
if (a < 0 || z < 0 || a >= z) {
|
||||||
@@ -153,7 +153,7 @@ fn rejectpair(label: str, td: str, target: str, needle: str) void = {
|
|||||||
s += 1;
|
s += 1;
|
||||||
};
|
};
|
||||||
if (!testenv.same(units[0], units[1])) {
|
if (!testenv.same(units[0], units[1])) {
|
||||||
fail("rootorder", "C/WW __root.unit.ww differ");
|
fail("rootorder", "C/WW rootok.unit.ww differ");
|
||||||
};
|
};
|
||||||
testenv.clean(td);
|
testenv.clean(td);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user