main: don't consider compile-only tests as failing

Previously a command like the following would incorrectly print FAIL:

    tinygo test -c math

This commit fixes this issue by defaulting to a passing test (the test
is marked as passed if it isn't run).
This commit is contained in:
Ayke van Laethem
2021-06-02 12:44:02 +02:00
committed by Ron Evans
parent 793a3175d3
commit 4c95febeee
+1 -1
View File
@@ -145,7 +145,7 @@ func Test(pkgName string, options *compileopts.Options, testCompileOnly bool, ou
return false, err
}
var passed bool
passed := true
err = builder.Build(pkgName, outpath, config, func(result builder.BuildResult) error {
if testCompileOnly || outpath != "" {
// Write test binary to the specified file name.