]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: disable use of -linkmode=external in tests when CGO_ENABLED=0
authorRuss Cox <rsc@golang.org>
Thu, 17 Dec 2015 03:40:15 +0000 (22:40 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 17 Dec 2015 05:46:21 +0000 (05:46 +0000)
If cgo is turned off, there may not be an external linker available.

Fixes #13450.

Change-Id: Idbf3f3f57b4bb3908b67264f96d276acc952102a
Reviewed-on: https://go-review.googlesource.com/17941
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/note_test.go

index bfaa75f6c30cb2e77130114a3fd543c3c253bce0..811734b37728fcffd8a989caf8fd539da0cd2421 100644 (file)
@@ -6,6 +6,7 @@ package main_test
 
 import (
        main "cmd/go"
+       "go/build"
        "runtime"
        "testing"
 )
@@ -42,6 +43,8 @@ func testNoteReading(t *testing.T) {
        }
 
        switch {
+       case !build.Default.CgoEnabled:
+               t.Skipf("skipping - no cgo, so assuming external linking not available")
        case runtime.GOOS == "linux" && (runtime.GOARCH == "ppc64le" || runtime.GOARCH == "ppc64"):
                t.Skipf("skipping - external linking not supported, golang.org/issue/11184")
        case runtime.GOOS == "linux" && (runtime.GOARCH == "mips64le" || runtime.GOARCH == "mips64"):