diff options
| author | Daniel Morsing <daniel.morsing@gmail.com> | 2025-12-01 15:13:08 +0000 |
|---|---|---|
| committer | Daniel Morsing <daniel.morsing@gmail.com> | 2026-02-21 00:01:01 -0800 |
| commit | 841fafcd583b37ba316a66fc388f966a5be8de80 (patch) | |
| tree | 4d68b8d1ef3c3b94cf6f55fc84f920af8752d525 /src/runtime | |
| parent | 34b9742c817d1c689f09af71364f52711524cc09 (diff) | |
| download | go-841fafcd583b37ba316a66fc388f966a5be8de80.tar.xz | |
runtime/secret: run crash tests under memory validating modes
The crashing test for runtime/secret does not run afoul of the memory
validators like the standard tests does. Pass through to the crashing
binary to shake out as many problems as possible.
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-asan-clang15,gotip-linux-amd64-msan-clang15,gotip-linux-arm64-asan-clang15
Change-Id: I1999fc2012ef520c80cf77d5b2d4bf4b1b8cb0b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/724622
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/secret/crash_test.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/runtime/secret/crash_test.go b/src/runtime/secret/crash_test.go index 1bd099aa93..6cd51bc15a 100644 --- a/src/runtime/secret/crash_test.go +++ b/src/runtime/secret/crash_test.go @@ -10,6 +10,9 @@ import ( "bytes" "debug/elf" "fmt" + "internal/asan" + "internal/msan" + "internal/race" "internal/testenv" "io" "os" @@ -120,7 +123,18 @@ func TestCore(t *testing.T) { t.Fatalf("error initing module %v\n%s", err, out) } - cmd = exec.Command(testenv.GoToolPath(t), "build", "-o", filepath.Join(tmpDir, "a.exe")) + // Pass through the flags for any of the memory validating modes + args := []string{"build", "-o", filepath.Join(tmpDir, "a.exe")} + if msan.Enabled { + args = append(args, "-msan") + } + if asan.Enabled { + args = append(args, "-asan") + } + if race.Enabled { + args = append(args, "-race") + } + cmd = exec.Command(testenv.GoToolPath(t), args...) cmd.Dir = tmpDir out, err = testenv.CleanCmdEnv(cmd).CombinedOutput() if err != nil { |
