Jelajahi Sumber

Only test with -race on supported platforms (fixes #2765)

Jakob Borg 10 tahun lalu
induk
melakukan
54c1ffe5f3
1 mengubah file dengan 12 tambahan dan 1 penghapusan
  1. 12 1
      build.go

+ 12 - 1
build.go

@@ -188,7 +188,18 @@ func setup() {
 
 func test(pkg string) {
 	setBuildEnv()
-	runPrint("go", "test", "-short", "-race", "-timeout", "60s", pkg)
+	useRace := runtime.GOARCH == "amd64"
+	switch runtime.GOOS {
+	case "darwin", "linux", "freebsd", "windows":
+	default:
+		useRace = false
+	}
+
+	if useRace {
+		runPrint("go", "test", "-short", "-race", "-timeout", "60s", pkg)
+	} else {
+		runPrint("go", "test", "-short", "-timeout", "60s", pkg)
+	}
 }
 
 func bench(pkg string) {