mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 07:53:40 +00:00
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.
This commit is contained in:
committed by
Ron Evans
parent
0964176b4d
commit
9a6071920f
@@ -291,7 +291,8 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options
|
|||||||
})
|
})
|
||||||
|
|
||||||
if testConfig.CompileOnly {
|
if testConfig.CompileOnly {
|
||||||
return true, nil
|
// Return the compiler error, if there is one.
|
||||||
|
return true, err
|
||||||
}
|
}
|
||||||
|
|
||||||
importPath := strings.TrimSuffix(result.ImportPath, ".test")
|
importPath := strings.TrimSuffix(result.ImportPath, ".test")
|
||||||
@@ -1864,6 +1865,7 @@ func main() {
|
|||||||
wd = ""
|
wd = ""
|
||||||
}
|
}
|
||||||
diagnostics.CreateDiagnostics(err).WriteTo(os.Stderr, wd)
|
diagnostics.CreateDiagnostics(err).WriteTo(os.Stderr, wd)
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
if !passed {
|
if !passed {
|
||||||
select {
|
select {
|
||||||
|
|||||||
Reference in New Issue
Block a user