From: Maciej Żok Date: Tue, 30 May 2023 18:29:05 +0000 (+0000) Subject: cmd/go: enable fuzz testing on OpenBSD X-Git-Tag: go1.25rc1~705 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=580b6ee646809cdd409b3e0d311e1ec35c72aa6b;p=gostls13.git cmd/go: enable fuzz testing on OpenBSD This change provides support for -fuzz flag on OpenBSD. According to #46554 the flag was unsupported on some OSes due to lack of proper testing. Fixes: #60491 Change-Id: I49835131d3ee23f6482583b518b9c5c224fc4efe GitHub-Last-Rev: f697a3c0f2dc36cc3c96c0336281c5e2440f7a1a GitHub-Pull-Request: golang/go#60520 Reviewed-on: https://go-review.googlesource.com/c/go/+/499335 LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase Reviewed-by: qiu laidongfeng2 <2645477756@qq.com> Reviewed-by: Bryan Mills Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor --- diff --git a/src/internal/fuzz/counters_supported.go b/src/internal/fuzz/counters_supported.go index 79e27d27e1..a71d98d266 100644 --- a/src/internal/fuzz/counters_supported.go +++ b/src/internal/fuzz/counters_supported.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (darwin || linux || windows || freebsd) && (amd64 || arm64) +//go:build (darwin || linux || windows || freebsd || openbsd) && (amd64 || arm64) package fuzz diff --git a/src/internal/fuzz/counters_unsupported.go b/src/internal/fuzz/counters_unsupported.go index 287bb4bd3c..156919ec2e 100644 --- a/src/internal/fuzz/counters_unsupported.go +++ b/src/internal/fuzz/counters_unsupported.go @@ -8,7 +8,7 @@ // // If you update this constraint, also update internal/platform.FuzzInstrumented. // -//go:build !((darwin || linux || windows || freebsd) && (amd64 || arm64)) +//go:build !((darwin || linux || windows || freebsd || openbsd) && (amd64 || arm64)) package fuzz diff --git a/src/internal/fuzz/minimize_test.go b/src/internal/fuzz/minimize_test.go index 2db2633896..e7e23e5a05 100644 --- a/src/internal/fuzz/minimize_test.go +++ b/src/internal/fuzz/minimize_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build darwin || freebsd || linux || windows +//go:build darwin || freebsd || linux || openbsd || windows package fuzz diff --git a/src/internal/fuzz/sys_posix.go b/src/internal/fuzz/sys_posix.go index fec6054f67..40d3771c2a 100644 --- a/src/internal/fuzz/sys_posix.go +++ b/src/internal/fuzz/sys_posix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build darwin || freebsd || linux +//go:build darwin || freebsd || linux || openbsd package fuzz diff --git a/src/internal/fuzz/sys_unimplemented.go b/src/internal/fuzz/sys_unimplemented.go index 8687c1f963..30766ba525 100644 --- a/src/internal/fuzz/sys_unimplemented.go +++ b/src/internal/fuzz/sys_unimplemented.go @@ -4,7 +4,7 @@ // If you update this constraint, also update internal/platform.FuzzSupported. // -//go:build !darwin && !freebsd && !linux && !windows +//go:build !darwin && !freebsd && !linux && !openbsd && !windows package fuzz diff --git a/src/internal/platform/supported.go b/src/internal/platform/supported.go index 702a255e4c..ad8dc93086 100644 --- a/src/internal/platform/supported.go +++ b/src/internal/platform/supported.go @@ -61,7 +61,7 @@ func ASanSupported(goos, goarch string) bool { // ('go test -fuzz=.'). func FuzzSupported(goos, goarch string) bool { switch goos { - case "darwin", "freebsd", "linux", "windows": + case "darwin", "freebsd", "linux", "openbsd", "windows": return true default: return false