From 2c929d6f4c8fcd1021dc3cd57b2eedff5ae9a592 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 22 Jan 2025 17:18:19 -0500 Subject: runtime: pass through -asan/-msan/-race to testprog tests The tests using testprog / testprogcgo are currently not covered on the asan/msan/race builders because they don't build testprog with the sanitizer flag. Explicitly pass the flag if the test itself is built with the sanitizer. There were a few tests that explicitly passed -race (even on non-race builders). These tests will now only run on race builders. For #71395. Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-asan-clang15,gotip-linux-amd64-msan-clang15,gotip-linux-amd64-race Change-Id: I6a6a636ce8271246316a80d426c0e4e2f6ab99c5 Reviewed-on: https://go-review.googlesource.com/c/go/+/643897 LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek Auto-Submit: Michael Pratt --- src/os/exec/exec_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/os/exec/exec_test.go') diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index 8c62387193..3bded3dea6 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -683,7 +683,10 @@ func TestExtraFiles(t *testing.T) { // This test runs with cgo disabled. External linking needs cgo, so // it doesn't work if external linking is required. - testenv.MustInternalLink(t, false) + // + // N.B. go build below explictly doesn't pass through + // -asan/-msan/-race, so we don't care about those. + testenv.MustInternalLink(t, testenv.NoSpecialBuildTypes) if runtime.GOOS == "windows" { t.Skipf("skipping test on %q", runtime.GOOS) -- cgit v1.3