Skip to content

Commit dbf174d

Browse files
committed
cmd/dist: test cmd module on js/wasm
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 <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent ae3abf1 commit dbf174d

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

src/cmd/dist/build.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,10 +1427,6 @@ func cmdbootstrap() {
14271427
xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
14281428
}
14291429
targets := []string{"std", "cmd"}
1430-
if goos == "js" && goarch == "wasm" {
1431-
// Skip the cmd tools for js/wasm. They're not usable.
1432-
targets = targets[:1]
1433-
}
14341430
goInstall(goBootstrap, targets...)
14351431
checkNotStale(goBootstrap, targets...)
14361432
checkNotStale(cmdGo, targets...)

src/cmd/dist/test.go

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,7 @@ func (t *tester) run() {
162162
// Instead, we can just check that it is not stale, which may be less
163163
// expensive (and is also more likely to catch bugs in the builder
164164
// implementation).
165-
willTest := []string{"std"}
166-
if t.shouldTestCmd() {
167-
willTest = append(willTest, "cmd")
168-
}
169-
checkNotStale("go", willTest...)
165+
checkNotStale("go", "std", "cmd")
170166
}
171167
}
172168

@@ -490,10 +486,7 @@ func (t *tester) registerTests() {
490486
if t.race {
491487
cmd.Args = append(cmd.Args, "-tags=race")
492488
}
493-
cmd.Args = append(cmd.Args, "std")
494-
if t.shouldTestCmd() {
495-
cmd.Args = append(cmd.Args, "cmd")
496-
}
489+
cmd.Args = append(cmd.Args, "std", "cmd")
497490
cmd.Stderr = new(bytes.Buffer)
498491
all, err := cmd.Output()
499492
if err != nil {
@@ -1682,14 +1675,6 @@ func (t *tester) shouldUsePrecompiledStdTest() bool {
16821675
return err == nil
16831676
}
16841677

1685-
func (t *tester) shouldTestCmd() bool {
1686-
if goos == "js" && goarch == "wasm" {
1687-
// Issues 25911, 35220
1688-
return false
1689-
}
1690-
return true
1691-
}
1692-
16931678
// prebuiltGoPackageTestBinary returns the path where we'd expect
16941679
// the pre-built go test binary to be on disk when dist test is run with
16951680
// a single argument.

0 commit comments

Comments
 (0)