Skip to content

Commit 80704ec

Browse files
runtime: test for cgo build tag in TestGdbPythonCgo
Testing whether cgo is enabled in go/build is not the same as testing whether the go tool supports cgo. They differ, for example, when using GOARCH=386 on an amd64 system, as for a cross-build cgo is disabled by default. Change-Id: Ib59106c92a3131b73ac6a91c0f7658a1769acf73 Reviewed-on: https://go-review.googlesource.com/c/go/+/174098 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 3f7276c commit 80704ec

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/runtime/runtime-gdb_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package runtime_test
77
import (
88
"bytes"
99
"fmt"
10-
"go/build"
1110
"internal/testenv"
1211
"io/ioutil"
1312
"os"
@@ -140,8 +139,8 @@ func TestGdbPythonCgo(t *testing.T) {
140139
}
141140

142141
func testGdbPython(t *testing.T, cgo bool) {
143-
if cgo && !build.Default.CgoEnabled {
144-
t.Skip("skipping because cgo is not enabled")
142+
if cgo {
143+
testenv.MustHaveCGO(t)
145144
}
146145

147146
checkGdbEnvironment(t)

0 commit comments

Comments
 (0)