]> Cypherpunks.ru repositories - gostls13.git/commit
misc/cgo/testcshared: don't rely on an erroneous install target in tests
authorBryan C. Mills <bcmills@google.com>
Tue, 12 Jul 2022 17:43:02 +0000 (13:43 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 13 Jul 2022 20:43:20 +0000 (20:43 +0000)
commitfeada5366134772c4c6462e4a12150410741a00f
tree3460f136df78009285fc0a31e78ff486bbf8df0c
parentc006b7ac2765252f397dec40fef610a3c17d956d
misc/cgo/testcshared: don't rely on an erroneous install target in tests

Non-main packages in module mode should not be installed to
GOPATH/pkg, but due to #37015 they were installed there anyway.

This change switches the 'go install' command in createHeaders to
instead use 'go build' (with an extension determined by the install
target for 'runtime/cgo', which is well-defined at least for the
moment), and switches TestCachedInstall (which appears to be
explicitly testing 'go install') to explicitly request GOPATH mode
(which provides a well-defined install target for the library).

This change follows a similar structure to CL 416954.

For #37015.

Change-Id: I22ae4af0f0d4c50adc9e0f0dc279859d1f258cc8
Reviewed-on: https://go-review.googlesource.com/c/go/+/417096
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
misc/cgo/testcshared/cshared_test.go