From edc9319e0dcc6f22b02aabe5d7488ed4857692a8 Mon Sep 17 00:00:00 2001 From: Nia Waldvogel Date: Sun, 2 Jan 2022 10:59:57 -0500 Subject: [PATCH] main (tinygo test): fail tests on build error This fixes a bug where build errors (e.g. linker errors) would be ignored by tinygo test. --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 455a3351..99894965 100644 --- a/main.go +++ b/main.go @@ -185,7 +185,7 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options return false, err } - passed := true + passed := false err = builder.Build(pkgName, outpath, config, func(result builder.BuildResult) error { if testCompileOnly || outpath != "" { // Write test binary to the specified file name. @@ -198,6 +198,7 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options } if testCompileOnly { // Do not run the test. + passed = true return nil }