diff options
| author | Meng Zhuo <mzh@golangcn.org> | 2021-12-30 16:46:21 +0800 |
|---|---|---|
| committer | mzh <mzh@golangcn.org> | 2022-04-01 01:18:52 +0000 |
| commit | be8ee5a58f8c30e95e425779fb31b2ae4e35cb8c (patch) | |
| tree | a8f429dcdc5b703bf1be5f18894ebcf4f827b6e3 /src | |
| parent | c4efe7fb2777fca05a904b0c62bee8915e13b03f (diff) | |
| download | go-be8ee5a58f8c30e95e425779fb31b2ae4e35cb8c.tar.xz | |
cmd/dist: enable msan/asan
Supporting memory sanitizer and address sanitizer in toolchains
Change-Id: Ie292657b78954d65bd72e64e063b1c4f18d4f0d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/374974
Trust: mzh <mzh@golangcn.org>
Run-TryBot: mzh <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/dist/test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index a540a2abda..9118c133e5 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -38,6 +38,9 @@ func cmdtest() { flag.StringVar(&t.runRxStr, "run", os.Getenv("GOTESTONLY"), "run only those tests matching the regular expression; empty means to run all. "+ "Special exception: if the string begins with '!', the match is inverted.") + flag.BoolVar(&t.msan, "msan", false, "run in memory sanitizer builder mode") + flag.BoolVar(&t.asan, "asan", false, "run in address sanitizer builder mode") + xflagparse(-1) // any number of args if noRebuild { t.rebuild = false @@ -49,6 +52,8 @@ func cmdtest() { // tester executes cmdtest. type tester struct { race bool + msan bool + asan bool listMode bool rebuild bool failed bool @@ -404,6 +409,12 @@ func (t *tester) registerStdTest(pkg string) { if t.race { args = append(args, "-race") } + if t.msan { + args = append(args, "-msan") + } + if t.asan { + args = append(args, "-asan") + } if t.compileOnly { args = append(args, "-run=^$") } |
