]> Cypherpunks repositories - gostls13.git/commitdiff
internal/testdir: move to cmd/internal/testdir
authorDmitri Shuralyov <dmitshur@golang.org>
Tue, 9 May 2023 13:50:19 +0000 (09:50 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 12 May 2023 17:18:08 +0000 (17:18 +0000)
The effect and motivation is for the test to be selected when doing
'go test cmd' and not when doing 'go test std' since it's primarily
about testing the Go compiler and linker. Other than that, it's run
by all.bash and 'go test std cmd' as before.

For #56844.
Fixes #60059.

Change-Id: I2d499af013f9d9b8761fdf4573f8d27d80c1fccf
Reviewed-on: https://go-review.googlesource.com/c/go/+/493876
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/dist/test.go
src/cmd/internal/testdir/testdir_test.go [moved from src/internal/testdir/testdir_test.go with 100% similarity]
test/README.md
test/codegen/README

index 48403bd434bb47c7a091606c51a1973f08995c2f..8cd8abc19ec172ca4467abc395e5518158ceeff0 100644 (file)
@@ -530,7 +530,7 @@ func (t *tester) registerTests() {
        // registerStdTestSpecially tracks import paths in the standard library
        // whose test registration happens in a special way.
        registerStdTestSpecially := map[string]bool{
-               "internal/testdir": true, // Registered at the bottom with sharding.
+               "cmd/internal/testdir": true, // Registered at the bottom with sharding.
                // cgo tests are registered specially because they involve unusual build
                // conditions and flags.
                "cmd/cgo/internal/teststdio":      true,
@@ -858,7 +858,7 @@ func (t *tester) registerTests() {
                                fmt.Sprintf("test:%d_%d", shard, nShards),
                                "../test",
                                &goTest{
-                                       pkg:       "internal/testdir",
+                                       pkg:       "cmd/internal/testdir",
                                        testFlags: []string{fmt.Sprintf("-shard=%d", shard), fmt.Sprintf("-shards=%d", nShards)},
                                        runOnHost: true,
                                },
index 7e3948f94749df3a6526a00ab35bc920dde955b9..1d37f2d5ca9a82dfaecc63ce004773f653c85996 100644 (file)
@@ -4,11 +4,11 @@ They are run as part of all.bash.
 
 To run just these tests, execute:
 
-       ../bin/go test internal/testdir
+       ../bin/go test cmd/internal/testdir
 
 To run just tests from specified files in this directory, execute:
 
-       ../bin/go test internal/testdir -run='Test/(file1.go|file2.go|...)'
+       ../bin/go test cmd/internal/testdir -run='Test/(file1.go|file2.go|...)'
 
 Standard library tests should be written as regular Go tests in the appropriate package.
 
index 1d68780394121be973d55c917350fc65fa07a235..5a4684284b99b7422c9fc15c7bba654e342adb34 100644 (file)
@@ -21,7 +21,7 @@ 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:
 
-  $ ../../bin/go test internal/testdir -run='Test/codegen' -all_codegen -v
+  $ ../../bin/go test cmd/internal/testdir -run='Test/codegen' -all_codegen -v
 
 This is recommended after any change that affect the compiler's code.