]> Cypherpunks repositories - gostls13.git/commit
cmd/fix: disallow cgo errors in tests
authorBryan C. Mills <bcmills@google.com>
Tue, 15 Nov 2022 17:34:31 +0000 (12:34 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 16 Nov 2022 22:02:42 +0000 (22:02 +0000)
commit17de9e2d18a62e28bb8032b04d81835e7705d4c7
tree344f08284e572adfc24a49d1ecbf0187ab1662e2
parent52d9e41ac303cfed4c4cfe86ec6d663a18c3448d
cmd/fix: disallow cgo errors in tests

The 'cgo' command invoked by 'go fix' was not valid when built with
-trimpath, but the test was not failing because errors from the
command were being logged and ignored instead of causing tests to
fail. Changing the code and test not to ignore the errors revealed
that a number of existing tests were always, unconditionally
triggering cgo errors which were then ignored.

This change updates those tests to no longer produce cgo errors,
and to check their results when cgo is enabled.

For #51473.
Updates #51461.

Change-Id: Ib9d1ea93f26d30daa824d75ed634eaf530af086d
Reviewed-on: https://go-review.googlesource.com/c/go/+/450714
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
src/cmd/fix/cftype_test.go
src/cmd/fix/egltype_test.go
src/cmd/fix/jnitype_test.go
src/cmd/fix/main_test.go
src/cmd/fix/typecheck.go