]> Cypherpunks repositories - gostls13.git/commit
cmd/dist: convert most remaining tests to use goTest
authorAustin Clements <austin@google.com>
Fri, 4 Nov 2022 18:54:04 +0000 (14:54 -0400)
committerAustin Clements <austin@google.com>
Wed, 16 Nov 2022 21:35:23 +0000 (21:35 +0000)
commit898d000c39af73e6d71e89e82c558b343d764e36
tree44074bc71f555ab5e394d2573c3eec2e8feb7166
parent36ce2ece09f74cc8d71cc1d097b62be6264ddb86
cmd/dist: convert most remaining tests to use goTest

This converts most of the remaining manual "go test" command line
construction in cmd/dist to use the goTest abstraction and
registerTest.

At this point, the only remaining place that directly constructs go
test command lines is runHostTest.

This fixes a bug in the "nolibgcc:os/user" test. It was clearly
supposed to pass "-run=^Test[^CS]", but the logic to override the
"-run" flag for "nolibgcc:net" caused "nolibgcc:os/user" to pass
*both* "-run=^Test[^CS]" and "-run=". This was then rewritten into
just "-run=" by flattenCmdline, which caused all os/user tests to run,
and not actually skip the expensive tests as intended. (This is a
great example of why the new abstraction is much more robust than
command line construction.)

I traced all exec calls from cmd/dist on linux/amd64 and, other than
the fix to nolibgcc:os/user, this makes only no-op changes (such as
re-arranging the order of flags).

For #37486.

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