From 06b7b4086385e4238be692301731f2285a157e12 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 4 Aug 2025 14:28:05 +0200 Subject: [PATCH] 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. --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index a854a75073..e5d122b79b 100644 --- a/main.go +++ b/main.go @@ -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 {