]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: skip TestVetWithOnlyCgoFiles when cgo is disabled
authorDavid du Colombier <0intro@gmail.com>
Wed, 7 Mar 2018 22:03:24 +0000 (23:03 +0100)
committerDavid du Colombier <0intro@gmail.com>
Wed, 7 Mar 2018 22:03:43 +0000 (22:03 +0000)
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>
src/cmd/go/go_test.go

index 0e44004cb1bdb888671799faf9ddf41b85373be9..d66ac20aa46e1742ed0ca6379e6b96d41ce3d432 100644 (file)
@@ -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()