ww: package-level -c -o names the single package's test artifact
The last Open-driver-work bullet. `-c -o <name>` replaces the fixed
<package>.test stem for exactly one package; the coordinator rejects a
multi-package fan-out ("cannot use -o with multiple packages", Go's
`go test -o` rule) and -o without -c is rejected at the driver
("needs -c for a package target" — a plain run executes from the temp
root, so a caller-owned name has nothing to name). Both driver stages
byte-identical wording; -S keeps its single-file-only reject.
package_test gains the contract row (naming, fixed-stem absence,
artifact runs, both rejects, both drivers); the tree-mode -o row's
pinned wording follows the contract.
This commit is contained in:
@@ -1696,9 +1696,16 @@ do_test(int argc, char **argv)
|
||||
size_t tlen = strlen(target);
|
||||
if (strcmp(target, "...") == 0 ||
|
||||
(tlen >= 4 && strcmp(target + tlen - 4, "/...") == 0)) {
|
||||
if (outstem[0]) {
|
||||
if (emit_asm) {
|
||||
fprintf(stderr,
|
||||
"ww test: -c/-S/-o need a single test file\n");
|
||||
"ww test: -S needs a single test file\n");
|
||||
return 2;
|
||||
}
|
||||
/* -c -o forwards: the coordinator names the single
|
||||
* package's artifact and rejects a multi-package fan-out. */
|
||||
if (outstem[0] && !compileonly) {
|
||||
fprintf(stderr,
|
||||
"ww test: -o needs -c for a package target\n");
|
||||
return 2;
|
||||
}
|
||||
if (workdir[0]) {
|
||||
@@ -1725,9 +1732,14 @@ do_test(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
if (is_dir) {
|
||||
if (outstem[0]) {
|
||||
if (emit_asm) {
|
||||
fprintf(stderr,
|
||||
"ww test: -c/-S/-o need a single test file\n");
|
||||
"ww test: -S needs a single test file\n");
|
||||
return 2;
|
||||
}
|
||||
if (outstem[0] && !compileonly) {
|
||||
fprintf(stderr,
|
||||
"ww test: -o needs -c for a package target\n");
|
||||
return 2;
|
||||
}
|
||||
if (workdir[0]) {
|
||||
@@ -1862,8 +1874,12 @@ do_test(int argc, char **argv)
|
||||
fprintf(stderr, "ww test: %s is neither file nor directory\n", target);
|
||||
return 1;
|
||||
}
|
||||
if (outstem[0]) {
|
||||
fprintf(stderr, "ww test: -c/-S/-o need a single test file\n");
|
||||
if (emit_asm) {
|
||||
fprintf(stderr, "ww test: -S needs a single test file\n");
|
||||
return 2;
|
||||
}
|
||||
if (outstem[0] && !compileonly) {
|
||||
fprintf(stderr, "ww test: -o needs -c for a package target\n");
|
||||
return 2;
|
||||
}
|
||||
if (workdir[0]) {
|
||||
|
||||
Reference in New Issue
Block a user