]> Cypherpunks repositories - gostls13.git/commit
cmd/dist: actually only compile tests with -compile-only
authorAustin Clements <austin@google.com>
Mon, 24 Apr 2023 18:26:39 +0000 (14:26 -0400)
committerAustin Clements <austin@google.com>
Tue, 25 Apr 2023 19:49:28 +0000 (19:49 +0000)
commitce0b9143123abe8005a059c92dbd763f7ab46214
tree65a1510010fb7d70517017ac3a2226a4751906d9
parent715d53c090ea02dbd73c301684ecbd09b476989e
cmd/dist: actually only compile tests with -compile-only

Currently, "dist test -compile-only" still runs the test binaries,
just with -run=^$ so no tests are run. It does this because, until
recently, "go test -c" would fail if passed multiple test packages.
But this has some unexpected consequences: init code still runs,
TestMain still runs, and we generally can't test cross-compiling of
tests.

Now that #15513 is fixed, we can pass multiple packages to "go test
-c". Hence, this CL make dist just use "go test -c" as one would
expect.

Found in the course of working on #37486, though it doesn't really
affect that.

Change-Id: If7d3c72c9e0f74d4ea0dd422411e5ee93b314be4
Reviewed-on: https://go-review.googlesource.com/c/go/+/488275
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Austin Clements <austin@google.com>
src/cmd/dist/test.go
src/testing/testing.go