From 0e9050009a3d1fd766d435a52d4c1e53a8f1b166 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 2 Dec 2014 08:15:26 +0900 Subject: [PATCH] tools/cmd/vet: check that cgo is enabled before testing it Should fix the tools builders. LGTM=bradfitz R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/176530043 --- cmd/stringer/endtoend_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/stringer/endtoend_test.go b/cmd/stringer/endtoend_test.go index ae2cc0a5a8..7e4e98fc2c 100644 --- a/cmd/stringer/endtoend_test.go +++ b/cmd/stringer/endtoend_test.go @@ -6,6 +6,7 @@ package main import ( "fmt" + "go/build" "io" "io/ioutil" "os" @@ -45,6 +46,10 @@ func TestEndToEnd(t *testing.T) { t.Errorf("%s is not a Go file", name) continue } + if name == "cgo.go" && !build.Default.CgoEnabled { + t.Logf("cgo is no enabled for %s", name) + continue + } // Names are known to be ASCII and long enough. typeName := fmt.Sprintf("%c%s", name[0]+'A'-'a', name[1:len(name)-len(".go")]) stringerCompileAndRun(t, dir, stringer, typeName, name)