diff options
| author | Russ Cox <rsc@golang.org> | 2022-08-05 14:15:03 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2022-09-16 14:48:54 +0000 |
| commit | e4a2c38af5bdae12591004c3d35762d23da7a9bd (patch) | |
| tree | b38854b37e893c2eb905dbc252c6269ee11be572 /src/testing/fuzz.go | |
| parent | 819e3394c90e27483f1f6eabfb02d22c927a139d (diff) | |
| download | go-e4a2c38af5bdae12591004c3d35762d23da7a9bd.tar.xz | |
cmd/go, testing: add go test -skip flag
For proposal #41583, add a new 'go test -skip' flag to make it easy
to disable specific tests, benchmarks, examples, or fuzz targets.
Fixes #41583.
Change-Id: Id12a6575f505dafdce4a149aedc454a002e93afa
Reviewed-on: https://go-review.googlesource.com/c/go/+/421439
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/testing/fuzz.go')
| -rw-r--r-- | src/testing/fuzz.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testing/fuzz.go b/src/testing/fuzz.go index 87b60fc1bb..d885f44b32 100644 --- a/src/testing/fuzz.go +++ b/src/testing/fuzz.go @@ -471,12 +471,12 @@ func runFuzzTests(deps testDeps, fuzzTests []InternalFuzzTarget, deadline time.T if len(fuzzTests) == 0 || *isFuzzWorker { return ran, ok } - m := newMatcher(deps.MatchString, *match, "-test.run") + m := newMatcher(deps.MatchString, *match, "-test.run", *skip) tctx := newTestContext(*parallel, m) tctx.deadline = deadline var mFuzz *matcher if *matchFuzz != "" { - mFuzz = newMatcher(deps.MatchString, *matchFuzz, "-test.fuzz") + mFuzz = newMatcher(deps.MatchString, *matchFuzz, "-test.fuzz", *skip) } fctx := &fuzzContext{deps: deps, mode: seedCorpusOnly} root := common{w: os.Stdout} // gather output in one place @@ -532,7 +532,7 @@ func runFuzzing(deps testDeps, fuzzTests []InternalFuzzTarget) (ok bool) { if len(fuzzTests) == 0 || *matchFuzz == "" { return true } - m := newMatcher(deps.MatchString, *matchFuzz, "-test.fuzz") + m := newMatcher(deps.MatchString, *matchFuzz, "-test.fuzz", *skip) tctx := newTestContext(1, m) tctx.isFuzzing = true fctx := &fuzzContext{ |
