ww test: report no tests to run
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user