diff options
Diffstat (limited to 'test/run.go')
-rw-r--r-- | test/run.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/run.go b/test/run.go index a8d4baa3a..a8a6dedb2 100644 --- a/test/run.go +++ b/test/run.go @@ -71,8 +71,9 @@ const maxTests = 5000 func main() { flag.Parse() - goos = os.Getenv("GOOS") - goarch = os.Getenv("GOARCH") + goos = getenv("GOOS", runtime.GOOS) + goarch = getenv("GOARCH", runtime.GOARCH) + findExecCmd() // Disable parallelism if printing or if using a simulator. @@ -972,3 +973,11 @@ func envForDir(dir string) []string { env = append(env, "PWD="+dir) return env } + +func getenv(key, def string) string { + value := os.Getenv(key) + if value != "" { + return value + } + return def +} |