aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2018-03-07 23:03:24 +0100
committerAndrew Bonventre <andybons@golang.org>2018-03-29 15:24:13 +0000
commit8e1f12f001be4eefebb2930dd9f647a1a0a837ed (patch)
tree7241e8a845b20a390367551e18cf130546f3091a
parentac7c0ee26dda18076d5f6c151d8f920b43340ae3 (diff)
downloadgo-8e1f12f001be4eefebb2930dd9f647a1a0a837ed.tar.gz
go-8e1f12f001be4eefebb2930dd9f647a1a0a837ed.zip
[release-branch.go1.10] cmd/go: skip TestVetWithOnlyCgoFiles when cgo is disabled
CL 99175 added TestVetWithOnlyCgoFiles. However, this test is failing on platforms where cgo is disabled, because no file can be built. This change fixes TestVetWithOnlyCgoFiles by skipping this test when cgo is disabled. Fixes #24304. Change-Id: Ibb38fcd3e0ed1a791782145d3f2866f12117c6fe Reviewed-on: https://go-review.googlesource.com/99275 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit b1335037fad4c81ce296f652372aa631a29dcb48) Reviewed-on: https://go-review.googlesource.com/103223 Reviewed-by: David du Colombier <0intro@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-rw-r--r--src/cmd/go/go_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go
index a985f2afef..7e6b492db4 100644
--- a/src/cmd/go/go_test.go
+++ b/src/cmd/go/go_test.go
@@ -3235,6 +3235,10 @@ func TestGoVetWithOnlyTestFiles(t *testing.T) {
// Issue 24193.
func TestVetWithOnlyCgoFiles(t *testing.T) {
+ if !canCgo {
+ t.Skip("skipping because cgo not enabled")
+ }
+
tg := testgo(t)
defer tg.cleanup()
tg.parallel()