Skip to content

Commit 9a60719

Browse files
aykevldeadprogram
authored andcommitted
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.
1 parent 0964176 commit 9a60719

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options
291291
})
292292

293293
if testConfig.CompileOnly {
294-
return true, nil
294+
// Return the compiler error, if there is one.
295+
return true, err
295296
}
296297

297298
importPath := strings.TrimSuffix(result.ImportPath, ".test")
@@ -1864,6 +1865,7 @@ func main() {
18641865
wd = ""
18651866
}
18661867
diagnostics.CreateDiagnostics(err).WriteTo(os.Stderr, wd)
1868+
os.Exit(1)
18671869
}
18681870
if !passed {
18691871
select {

0 commit comments

Comments
 (0)