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).
Этот коммит содержится в:
Ayke van Laethem 2021-06-02 12:44:02 +02:00 коммит произвёл Ron Evans
родитель 793a3175d3
коммит 4c95febeee

Просмотреть файл

@ -145,7 +145,7 @@ func Test(pkgName string, options *compileopts.Options, testCompileOnly bool, ou
return false, err return false, err
} }
var passed bool passed := true
err = builder.Build(pkgName, outpath, config, func(result builder.BuildResult) error { err = builder.Build(pkgName, outpath, config, func(result builder.BuildResult) error {
if testCompileOnly || outpath != "" { if testCompileOnly || outpath != "" {
// Write test binary to the specified file name. // Write test binary to the specified file name.