aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorMauri de Souza Meneguzzo <mauri870@gmail.com>2023-12-11 00:22:50 +0000
committerGopher Robot <gobot@golang.org>2023-12-12 19:42:27 +0000
commitc2079deb24c3dd5189f09a34f4ccbe7bf5cffa42 (patch)
tree74ba89b980297ba404953c3da00e40827edcda8f /src/cmd
parent0ac1e3b245e4bfadfc1d5b9a3aaa87e26c6f2030 (diff)
downloadgo-c2079deb24c3dd5189f09a34f4ccbe7bf5cffa42.tar.xz
cmd/cgo/internal/testsanitizers: check for go build and cgo in fuzzer and msan tests
Make sure the platform we are running the tests on can compile programs and has cgo support in order to run the fuzzer and msan tests. This is the same approach used by the asan tests, which share the same requirements. Fixes #64626 Change-Id: I7c0b912dabdd1b7d7d44437e4ade5e5994994796 GitHub-Last-Rev: 9fae6970f0f3b32a24893ef32fc4b38fa5a2a96d GitHub-Pull-Request: golang/go#64640 Reviewed-on: https://go-review.googlesource.com/c/go/+/548715 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go3
-rw-r--r--src/cmd/cgo/internal/testsanitizers/msan_test.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go b/src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go
index f84c9f37ae..3f5b1d91c7 100644
--- a/src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go
+++ b/src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go
@@ -7,11 +7,14 @@
package sanitizers_test
import (
+ "internal/testenv"
"strings"
"testing"
)
func TestLibFuzzer(t *testing.T) {
+ testenv.MustHaveGoBuild(t)
+ testenv.MustHaveCGO(t)
goos, err := goEnv("GOOS")
if err != nil {
t.Fatal(err)
diff --git a/src/cmd/cgo/internal/testsanitizers/msan_test.go b/src/cmd/cgo/internal/testsanitizers/msan_test.go
index 1a22b5246c..83d66f6660 100644
--- a/src/cmd/cgo/internal/testsanitizers/msan_test.go
+++ b/src/cmd/cgo/internal/testsanitizers/msan_test.go
@@ -8,11 +8,14 @@ package sanitizers_test
import (
"internal/platform"
+ "internal/testenv"
"strings"
"testing"
)
func TestMSAN(t *testing.T) {
+ testenv.MustHaveGoBuild(t)
+ testenv.MustHaveCGO(t)
goos, err := goEnv("GOOS")
if err != nil {
t.Fatal(err)