ww test: report no tests to run

This commit is contained in:
2026-08-21 16:15:12 +09:00
parent 2387d3e2d2
commit 17b2879c3e
6 changed files with 443 additions and 24 deletions

View File

@@ -1819,6 +1819,15 @@ fn pkgemitinstall(g: *pkggroup) bool = {
return true;
};
// Pinned cmd/go recognizes the testing package's exact no-tests warning only
// at capture byte zero or after a newline. The harness owns whether a test ran;
// this coordinator owns only the corresponding package-result suffix.
fn pkgnoteststorun(output: str) bool = {
let first: str = "testing: warning: no tests to run\n";
let later: str = "\ntesting: warning: no tests to run\n";
return strings.hasprefix(output, first) || strings.contains(output, later);
};
fn pkgemitgroup(g: *pkggroup, compileonly: bool,
statusfailed: *bool) bool = {
if (g.notests) {
@@ -1850,6 +1859,9 @@ fn pkgemitgroup(g: *pkggroup, compileonly: bool,
};
pkgput(os.STDOUT_FILENO, "ok ");
pkglabel(g);
if (pkgnoteststorun(runoutput)) {
pkgput(os.STDOUT_FILENO, " [no tests to run]");
};
pkgput(os.STDOUT_FILENO, "\n");
return true;
};