diff options
| author | Dmitri Shuralyov <dmitshur@golang.org> | 2023-02-08 11:40:06 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-02-28 01:11:37 +0000 |
| commit | 7a0799b2c0bdfaf745dbd8c74a3db2f3d238fd1b (patch) | |
| tree | 873ad764e00d3aee2212539cb04411401b9bf208 /test/codegen | |
| parent | 01f5a17aa3b99af34ad7c914657fc7345fe562fe (diff) | |
| download | go-7a0799b2c0bdfaf745dbd8c74a3db2f3d238fd1b.tar.xz | |
cmd/dist, test: convert test/run.go runner to a cmd/go test
As motivated on the issue, we want to move the functionality of the
run.go program to happen via a normal go test. Each .go test case in
the GOROOT/test directory gets a subtest, and cmd/go's support for
parallel test execution replaces run.go's own implementation thereof.
The goal of this change is to have fairly minimal and readable diff
while making an atomic changeover. The working directory is modified
during the test execution to be GOROOT/test as it was with run.go,
and most of the test struct and its run method are kept unchanged.
The next CL in the stack applies further simplifications and cleanups
that become viable.
There's no noticeable difference in test execution time: it takes around
60-80 seconds both before and after on my machine. Test caching, which
the previous runner lacked, can shorten the time significantly.
For #37486.
Fixes #56844.
Change-Id: I209619dc9d90e7529624e49c01efeadfbeb5c9ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/463276
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'test/codegen')
| -rw-r--r-- | test/codegen/README | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/test/codegen/README b/test/codegen/README index b803fe585f..1d68780394 100644 --- a/test/codegen/README +++ b/test/codegen/README @@ -11,23 +11,22 @@ compiler. The test harness compiles Go code inside files in this directory and matches the generated assembly (the output of `go tool compile -S`) against a set of regexps to be specified in comments that follow a -special syntax (described below). The test driver is implemented as a -step of the top-level test/run.go suite, called "asmcheck". +special syntax (described below). The test driver is implemented as +an action within the GOROOT/test test suite, called "asmcheck". The codegen harness is part of the all.bash test suite, but for performance reasons only the codegen tests for the host machine's GOARCH are enabled by default, and only on GOOS=linux. To perform comprehensive tests for all the supported architectures -(even on a non-Linux system), one can run the following command +(even on a non-Linux system), one can run the following command: - $ ../bin/go run run.go -all_codegen -v codegen + $ ../../bin/go test internal/testdir -run='Test/codegen' -all_codegen -v -in the top-level test directory. This is recommended after any change -that affect the compiler's code. +This is recommended after any change that affect the compiler's code. The test harness compiles the tests with the same go toolchain that is -used to run run.go. After writing tests for a newly added codegen +used to run the test. After writing tests for a newly added codegen transformation, it can be useful to first run the test harness with a toolchain from a released Go version (and verify that the new tests fail), and then re-runnig the tests using the devel toolchain. |
