main: show the compiler erro (if any) for tinygo test -c

This fixes the bug that if there was a compiler error, it was silently
ignored.
This commit is contained in:
Ayke van Laethem
2025-08-04 14:28:05 +02:00
committed by Ron Evans
parent 0964176b4d
commit 9a6071920f
+3 -1
View File
@@ -291,7 +291,8 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options
})
if testConfig.CompileOnly {
return true, nil
// Return the compiler error, if there is one.
return true, err
}
importPath := strings.TrimSuffix(result.ImportPath, ".test")
@@ -1864,6 +1865,7 @@ func main() {
wd = ""
}
diagnostics.CreateDiagnostics(err).WriteTo(os.Stderr, wd)
os.Exit(1)
}
if !passed {
select {