aboutsummaryrefslogtreecommitdiff
path: root/src/internal/testenv
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/testenv')
-rw-r--r--src/internal/testenv/testenv.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/internal/testenv/testenv.go b/src/internal/testenv/testenv.go
index 9aecfaa695..ac65ce53fb 100644
--- a/src/internal/testenv/testenv.go
+++ b/src/internal/testenv/testenv.go
@@ -504,3 +504,26 @@ func ParallelOn64Bit(t *testing.T) {
}
t.Parallel()
}
+
+// CPUProfilingBroken returns true if CPU profiling has known issues on this
+// platform.
+func CPUProfilingBroken() bool {
+ switch runtime.GOOS {
+ case "plan9":
+ // Profiling unimplemented.
+ return true
+ case "aix":
+ // See https://golang.org/issue/45170.
+ return true
+ case "ios", "dragonfly", "netbsd", "illumos", "solaris":
+ // See https://golang.org/issue/13841.
+ return true
+ case "openbsd":
+ if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
+ // See https://golang.org/issue/13841.
+ return true
+ }
+ }
+
+ return false
+}