]> Cypherpunks repositories - gostls13.git/commit
cmd/go: consolidate fuzz-support checks
authorBryan C. Mills <bcmills@google.com>
Thu, 28 Oct 2021 19:00:33 +0000 (15:00 -0400)
committerBryan C. Mills <bcmills@google.com>
Thu, 28 Oct 2021 20:43:02 +0000 (20:43 +0000)
commite741e2fe0e51840b16bfc84d8daaba7670e7aac9
tree65f5efb6f05d5b511099b0c93c5dfc03ca09b4d2
parent834e36ec778c11b068a2d5354343d4668e5a9ceb
cmd/go: consolidate fuzz-support checks

We had been repeating conditions for specific platforms and
architectures to gate fuzzing tests, but the more of those tests we
add the more we will have to update if the set of supported platforms
and archictures expands over time.

We also ought to provide a friendlier error message when
'go test -fuzz' is used on non-supported platforms.

This change adds predicates in cmd/internal/sys, which already
contains similar predicates for related functionality (such as the
race detector), and uses those predicates in 'go test' and TestScript.

For #48495

Change-Id: If24c3997aeb4d201258e21e5b6cf4f7c08fbadd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/359481
Trust: Bryan C. Mills <bcmills@google.com>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
28 files changed:
src/cmd/go/go_test.go
src/cmd/go/internal/test/test.go
src/cmd/go/internal/work/init.go
src/cmd/go/script_test.go
src/cmd/go/testdata/script/README
src/cmd/go/testdata/script/test_fuzz.txt
src/cmd/go/testdata/script/test_fuzz_cache.txt
src/cmd/go/testdata/script/test_fuzz_chatty.txt
src/cmd/go/testdata/script/test_fuzz_cleanup.txt
src/cmd/go/testdata/script/test_fuzz_deadline.txt
src/cmd/go/testdata/script/test_fuzz_fuzztime.txt
src/cmd/go/testdata/script/test_fuzz_io_error.txt
src/cmd/go/testdata/script/test_fuzz_match.txt
src/cmd/go/testdata/script/test_fuzz_minimize.txt
src/cmd/go/testdata/script/test_fuzz_minimize_interesting.txt
src/cmd/go/testdata/script/test_fuzz_multiple.txt
src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt
src/cmd/go/testdata/script/test_fuzz_mutate_fail.txt
src/cmd/go/testdata/script/test_fuzz_mutator.txt
src/cmd/go/testdata/script/test_fuzz_non_crash_signal.txt
src/cmd/go/testdata/script/test_fuzz_parallel.txt
src/cmd/go/testdata/script/test_fuzz_run.txt
src/cmd/go/testdata/script/test_fuzz_seed_corpus.txt
src/cmd/go/testdata/script/test_fuzz_setenv.txt
src/cmd/go/testdata/script/test_fuzz_unsupported.txt [new file with mode: 0644]
src/cmd/internal/sys/supported.go
src/internal/fuzz/counters_unsupported.go
src/internal/fuzz/sys_unimplemented.go