From: Bryan C. Mills Date: Thu, 7 Oct 2021 15:20:05 +0000 (-0400) Subject: misc/cgo/testshared: pass the testing.T to goCmd when available X-Git-Tag: go1.18beta1~974 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b3a4b2df09be4e0a85f4204e71a4c1c8e542f4f8;p=gostls13.git misc/cgo/testshared: pass the testing.T to goCmd when available Noticed while investigating the test failure in https://build.golang.org/log/4fc4aa11087c74bb8f66c81a8b212f41fb495be4. Change-Id: I0ed80dad99d6920a187af4339e437a08fbe91ade Reviewed-on: https://go-review.googlesource.com/c/go/+/354572 Trust: Bryan C. Mills Reviewed-by: Ian Lance Taylor --- diff --git a/misc/cgo/testshared/shared_test.go b/misc/cgo/testshared/shared_test.go index e77f848915..1bd89bc27a 100644 --- a/misc/cgo/testshared/shared_test.go +++ b/misc/cgo/testshared/shared_test.go @@ -1033,7 +1033,7 @@ func TestGlobal(t *testing.T) { // Run a test using -linkshared of an installed shared package. // Issue 26400. func TestTestInstalledShared(t *testing.T) { - goCmd(nil, "test", "-linkshared", "-test.short", "sync/atomic") + goCmd(t, "test", "-linkshared", "-test.short", "sync/atomic") } // Test generated pointer method with -linkshared. @@ -1045,8 +1045,8 @@ func TestGeneratedMethod(t *testing.T) { // Test use of shared library struct with generated hash function. // Issue 30768. func TestGeneratedHash(t *testing.T) { - goCmd(nil, "install", "-buildmode=shared", "-linkshared", "./issue30768/issue30768lib") - goCmd(nil, "test", "-linkshared", "./issue30768") + goCmd(t, "install", "-buildmode=shared", "-linkshared", "./issue30768/issue30768lib") + goCmd(t, "test", "-linkshared", "./issue30768") } // Test that packages can be added not in dependency order (here a depends on b, and a adds