test: align package fixtures with Go semantics
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
package driver_test;
|
||||
|
||||
// `ww` driver CLI observers. Ports of the retired native carriers
|
||||
// test/wcc/949_driver_flagargs.c and 949_missingpkg.c; every
|
||||
// assertion preserved.
|
||||
// test/wcc/949_driver_flagargs.c and 949_missingpkg.c; the retired
|
||||
// second-positional single-file-only assertion now belongs to package-root
|
||||
// selection, while the remaining driver assertions stay here.
|
||||
//
|
||||
// flagargs (#15 B2) — `ww -V` exits 0 with stdout exactly
|
||||
// "ww <WW_VERSION>\n" and empty stderr; 15 flag-misuse rows each exit
|
||||
// "ww <WW_VERSION>\n" and empty stderr; 14 flag-misuse rows each exit
|
||||
// 2 with the row's stderr fragment; and on every row plus -V the
|
||||
// wwstage twin `ww_ww` matches the cstage `ww` byte-exactly on exit
|
||||
// code, stdout and stderr (rule 10 on the driver surface). The
|
||||
// version oracle is parsed from cmd/wcc/ww.h at run time, preserving
|
||||
// the carrier's exact-output ownership without a C toolchain
|
||||
// dependency. Rows run from a fresh scratch cwd: the `test . zzz` row
|
||||
// takes `.` positionally, so the cwd must never be the repo tree.
|
||||
// dependency.
|
||||
//
|
||||
// missingpkg (#16 ENFORCE-driver) — `ww build` over a source whose
|
||||
// only import cannot be located exits nonzero with "cannot find
|
||||
@@ -168,13 +168,13 @@ fn runrootargv(dir: str, root: str, name: str, drv: str,
|
||||
@test fn flagargs() void = {
|
||||
let a1: []str = ["build", "build", "build", "build", "build",
|
||||
"run", "run", "run", "test", "test", "test", "test", "test",
|
||||
"test", "test"];
|
||||
"test"];
|
||||
let a2: []str = ["-o", "-I", "-L", "-l", "-zz",
|
||||
"-o", "-l", "-zz", "-l", "-zz", "-I", "-o", "-o",
|
||||
"-run", "."];
|
||||
"-run"];
|
||||
let a3: []str = ["", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "x",
|
||||
"", "zzz"];
|
||||
""];
|
||||
let subs: []str = [
|
||||
"ww build: -o needs an argument",
|
||||
"ww build: -I needs an argument",
|
||||
@@ -189,8 +189,7 @@ fn runrootargv(dir: str, root: str, name: str, drv: str,
|
||||
"ww test: -I needs an argument",
|
||||
"ww test: -o needs an argument",
|
||||
"ww test: -o needs -c for a package target",
|
||||
"ww test: -run needs an argument",
|
||||
"ww test: pattern needs a single test file"];
|
||||
"ww test: -run needs an argument"];
|
||||
let i: i32 = 0;
|
||||
for (i < subs.len) {
|
||||
let td: str = testenv.fresh();
|
||||
@@ -231,8 +230,8 @@ fn runrootargv(dir: str, root: str, name: str, drv: str,
|
||||
// -o needs a writable stem: the output-derived .sepwork follows -o,
|
||||
// so /dev/null would yield an uncreatable /dev/null.sepwork and
|
||||
// mask the missing-package fatal.
|
||||
let av: []str = [testenv.driver("ww"), "build", src, "-o",
|
||||
strings.concat(td, "/miss.out")];
|
||||
let av: []str = [testenv.driver("ww"), "build", "-o",
|
||||
strings.concat(td, "/miss.out"), src];
|
||||
testenv.runcommand(td, td, "miss", av, tmo(), &co);
|
||||
assert(co.termination == exec.termination.EXIT);
|
||||
if (co.code == 0) {
|
||||
|
||||
Reference in New Issue
Block a user