]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: test cmd module on js/wasm
authorTobias Klauser <tklauser@distanz.ch>
Wed, 28 Sep 2022 17:19:44 +0000 (19:19 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Wed, 28 Sep 2022 18:39:27 +0000 (18:39 +0000)
Most tests will be skipped anyway because 'go build' is not available,
but this ensures cmd will be build tested by TryBots for js/wasm.

For #25911
For #35220
For #54219

Change-Id: I09c75905c36311810eb1ae75eeee2fa6102c1c0d
Reviewed-on: https://go-review.googlesource.com/c/go/+/435237
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/dist/build.go
src/cmd/dist/test.go

index 5d60ba153ea5b26cc96f97c3bf3325ccf08ee47d..4b2e545b2e027632e724acf08b73d207c16c93a7 100644 (file)
@@ -1427,10 +1427,6 @@ func cmdbootstrap() {
                xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
        }
        targets := []string{"std", "cmd"}
-       if goos == "js" && goarch == "wasm" {
-               // Skip the cmd tools for js/wasm. They're not usable.
-               targets = targets[:1]
-       }
        goInstall(goBootstrap, targets...)
        checkNotStale(goBootstrap, targets...)
        checkNotStale(cmdGo, targets...)
index 181b61dd934447eaae06253aee872900b31ef248..d27afb9fa1e26219d32a92dc831f7db4cc303f1a 100644 (file)
@@ -162,11 +162,7 @@ func (t *tester) run() {
                        // Instead, we can just check that it is not stale, which may be less
                        // expensive (and is also more likely to catch bugs in the builder
                        // implementation).
-                       willTest := []string{"std"}
-                       if t.shouldTestCmd() {
-                               willTest = append(willTest, "cmd")
-                       }
-                       checkNotStale("go", willTest...)
+                       checkNotStale("go", "std", "cmd")
                }
        }
 
@@ -490,10 +486,7 @@ func (t *tester) registerTests() {
                if t.race {
                        cmd.Args = append(cmd.Args, "-tags=race")
                }
-               cmd.Args = append(cmd.Args, "std")
-               if t.shouldTestCmd() {
-                       cmd.Args = append(cmd.Args, "cmd")
-               }
+               cmd.Args = append(cmd.Args, "std", "cmd")
                cmd.Stderr = new(bytes.Buffer)
                all, err := cmd.Output()
                if err != nil {
@@ -1682,14 +1675,6 @@ func (t *tester) shouldUsePrecompiledStdTest() bool {
        return err == nil
 }
 
-func (t *tester) shouldTestCmd() bool {
-       if goos == "js" && goarch == "wasm" {
-               // Issues 25911, 35220
-               return false
-       }
-       return true
-}
-
 // prebuiltGoPackageTestBinary returns the path where we'd expect
 // the pre-built go test binary to be on disk when dist test is run with
 // a single argument.