ww: print final status for explicit test failures

This commit is contained in:
2026-08-21 07:39:54 +09:00
parent b5fb478613
commit 394e46ff2f
7 changed files with 388 additions and 20 deletions

View File

@@ -273,11 +273,11 @@ fn execpackagetests(selfdir: *u8, argv: **u8, argc: i32, start: i32,
if (prog == nil) { return 1; };
};
if (start < 0 || start > argc || argc - start > SEP_COUNT_MAX - 10) {
if (start < 0 || start > argc || argc - start > SEP_COUNT_MAX - 11) {
sepfailsize();
return 1;
};
let cap: i32 = argc - start + 10;
let cap: i32 = argc - start + 11;
let execargv: []*u8;
let argvallocation: ([]*u8 | nomem) = sepallocptrs(cap);
match (argvallocation) {
@@ -300,6 +300,9 @@ fn execpackagetests(selfdir: *u8, argv: **u8, argc: i32, start: i32,
};
execargv[n] = "--ww-driver".ptr; n += 1;
execargv[n] = selfpath; n += 1;
if (!buildonly && !adddot) {
execargv[n] = "--ww-explicit-test-target".ptr; n += 1;
};
if (rootidentity != nil) {
execargv[n] = "--ww-root-identity".ptr; n += 1;
execargv[n] = rootidentity; n += 1;
@@ -9243,6 +9246,9 @@ fn runsingletest(selfdir: *u8, src: *u8, incs: *u8, compileonly: i32,
cerr("ww: cannot remove temporary directory\n");
};
};
if (compileonly == 0 && emitasm == 0) {
os.write(1, "FAIL\n".ptr, 5u64);
};
return 1;
};
if (compileonly != 0 || emitasm != 0) {
@@ -9292,6 +9298,7 @@ fn runsingletest(selfdir: *u8, src: *u8, incs: *u8, compileonly: i32,
if (toolbin != nil) {
os.free(toolbin: *void, cstrlen(toolbin) + 1u64);
};
let testfailed: bool = rc != 0;
if (rc == 0 && deferredinstall
&& sepinstalltestoutput(outp, outstem) != 0) { rc = 1; };
if (owntmp) {
@@ -9305,6 +9312,7 @@ fn runsingletest(selfdir: *u8, src: *u8, incs: *u8, compileonly: i32,
if (rc == 0) { rc = 1; };
};
};
if (testfailed) { os.write(1, "FAIL\n".ptr, 5u64); };
return rc;
};
@@ -9804,6 +9812,9 @@ fn dotest(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = {
if (resolved == nil) {
cerr("ww test: cannot find ");
os.write(2, target, cstrlen(target)); cerr("\n");
if (targetindex >= 0 && compileonly == 0 && emitasm == 0) {
os.write(1, "FAIL\n".ptr, 5u64);
};
return 1;
};
};