1
0
mirror of https://github.com/golang/go synced 2024-09-30 00:34:31 -06:00
go/misc/cgo
Austin Clements b079640404 misc/cgo/test: simplify for module mode
When we were first introducing module mode, CL 163418 moved many of
the tests in misc/cgo/test into their own test binary under testdata
so misc/cgo/test continued to work in both GOPATH mode and module
mode. This introduce a somewhat complicated test driver into
misc/cgo/test. Since the misc/cgo/test test had to invoke "go test" as
a subprocess, this required care to thread any build flags down into
the subprocess. The output from any failures of the sub-process was
also less than ideal.

Now that we don't have to worry about running these in GOPATH mode any
more, this CL moves all of the tests back into misc/cgo/test and drops
the test driver.

There are two slight complications:

- Test41761 was added after this split and has a C type "S" that's
  also present in misc/cgo/test itself. We rename that to keep that
  test working.

- TestCgo in go/internal/srcimporter now fails to import misc/cgo/test
  because misc/cgo/test now contains imports of other "misc" module
  packages and the importer it sets up isn't configured to allow that.
  We fix this by setting up a build context that's configured for
  this.

Preparation for #37486.

Change-Id: I3c4f73540e0482bbd493823cca44b0ce7fac01f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/447355
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-11-04 20:47:59 +00:00
..
errors misc/cgo: replace ioutil.ReadFile with os.ReadFile 2022-09-19 16:55:59 +00:00
fortran misc/cgo/fortran: convert to Go test 2022-10-17 15:15:37 +00:00
gmp all: gofmt main repo 2022-04-11 16:34:30 +00:00
life all: update references to symbols moved from io/ioutil to io 2021-04-05 17:51:15 +00:00
nocgo
stdio all: update references to symbols moved from io/ioutil to io 2021-04-05 17:51:15 +00:00
test misc/cgo/test: simplify for module mode 2022-11-04 20:47:59 +00:00
testcarchive misc/cgo: replace os.SEEK_SET with io.SeekStart 2022-09-19 16:55:26 +00:00
testcshared all: disable tests that fail on Alpine 2022-08-02 17:23:42 +00:00
testgodefs cmd/cgo: retain original file paths in godefs generated comment 2022-04-03 07:18:10 +00:00
testplugin cmd/compile: make jump table symbol local 2022-07-22 20:12:19 +00:00
testsanitizers cmd/dist, misc/cgo/testsanitizers: enable msan tests on freebsd/amd64 2022-10-14 12:48:50 +00:00
testshared cmd/go: don't install most GOROOT .a files in pkg 2022-10-28 23:35:08 +00:00
testso all: gofmt more (but vendor, testdata, and top-level test directories) 2021-08-13 20:45:17 +00:00
testsovar all: gofmt more (but vendor, testdata, and top-level test directories) 2021-08-13 20:45:17 +00:00
testtls all: gofmt more (but vendor, testdata, and top-level test directories) 2021-08-13 20:45:17 +00:00