Commit 80704ec3 authored by Ian Lance Taylor's avatar Ian Lance Taylor

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 <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 3f7276c0
...@@ -7,7 +7,6 @@ package runtime_test ...@@ -7,7 +7,6 @@ package runtime_test
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"go/build"
"internal/testenv" "internal/testenv"
"io/ioutil" "io/ioutil"
"os" "os"
...@@ -140,8 +139,8 @@ func TestGdbPythonCgo(t *testing.T) { ...@@ -140,8 +139,8 @@ func TestGdbPythonCgo(t *testing.T) {
} }
func testGdbPython(t *testing.T, cgo bool) { func testGdbPython(t *testing.T, cgo bool) {
if cgo && !build.Default.CgoEnabled { if cgo {
t.Skip("skipping because cgo is not enabled") testenv.MustHaveCGO(t)
} }
checkGdbEnvironment(t) checkGdbEnvironment(t)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment