aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRon Evans <[email protected]>2019-06-18 13:36:48 +0200
committerRon Evans <[email protected]>2019-06-18 13:45:11 +0200
commit16201c41dc69d4d7896e85653580dee35382fd23 (patch)
treeaec05a87b46fa314de3db618f26fdd46e89225bf
parent208e1719ad9a8e7ff94e8aac900909c37747a04f (diff)
downloadtinygo-16201c41dc69d4d7896e85653580dee35382fd23.tar.gz
tinygo-16201c41dc69d4d7896e85653580dee35382fd23.zip
test: replace ExitStatus() with go1.11 compatible syntax
Signed-off-by: Ron Evans <[email protected]>
-rw-r--r--main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.go b/main.go
index 97ea47d36..09310abb1 100644
--- a/main.go
+++ b/main.go
@@ -367,7 +367,10 @@ func Test(pkgName, target string, config *BuildConfig) error {
if err != nil {
// Propagate the exit code
if err, ok := err.(*exec.ExitError); ok {
- os.Exit(err.ExitCode())
+ if status, ok := err.Sys().(syscall.WaitStatus); ok {
+ os.Exit(status.ExitStatus())
+ }
+ os.Exit(1)
}
return &commandError{"failed to run compiled binary", tmppath, err}
}