Skip to content

Commit efed90a

Browse files
matloobcagedmantis
authored andcommitted
[release-branch.go1.14] cmd/go: convert TestBuildIDContainsArchModeEnv to the script framework
Part of converting all tests to script framework to improve test parallelism. Fixes #39824 Updates #36320 Updates #17751 Change-Id: I69c69809fb1698c8198ef3ea00103a9acb7b6ce7 Reviewed-on: https://go-review.googlesource.com/c/go/+/214387 Run-TryBot: Michael Matloob <matloob@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from CL 214387) Reviewed-on: https://go-review.googlesource.com/c/go/+/239738 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org>
1 parent 67d894e commit efed90a

File tree

2 files changed

+27
-39
lines changed

2 files changed

+27
-39
lines changed

src/cmd/go/go_test.go

-39
Original file line numberDiff line numberDiff line change
@@ -3955,45 +3955,6 @@ func TestCgoFlagContainsSpace(t *testing.T) {
39553955
tg.grepStderrNot(`"-L[^"]+c flags".*"-L[^"]+c flags"`, "found too many quoted ld flags")
39563956
}
39573957

3958-
// Issue 9737: verify that GOARM and GO386 affect the computed build ID.
3959-
func TestBuildIDContainsArchModeEnv(t *testing.T) {
3960-
if testing.Short() {
3961-
t.Skip("skipping in short mode")
3962-
}
3963-
3964-
var tg *testgoData
3965-
testWith := func(before, after func()) func(*testing.T) {
3966-
return func(t *testing.T) {
3967-
tg = testgo(t)
3968-
defer tg.cleanup()
3969-
tg.tempFile("src/mycmd/x.go", `package main
3970-
func main() {}`)
3971-
tg.setenv("GOPATH", tg.path("."))
3972-
3973-
tg.cd(tg.path("src/mycmd"))
3974-
tg.setenv("GOOS", "linux")
3975-
before()
3976-
tg.run("install", "mycmd")
3977-
after()
3978-
tg.wantStale("mycmd", "stale dependency", "should be stale after environment variable change")
3979-
}
3980-
}
3981-
3982-
t.Run("386", testWith(func() {
3983-
tg.setenv("GOARCH", "386")
3984-
tg.setenv("GO386", "387")
3985-
}, func() {
3986-
tg.setenv("GO386", "sse2")
3987-
}))
3988-
3989-
t.Run("arm", testWith(func() {
3990-
tg.setenv("GOARCH", "arm")
3991-
tg.setenv("GOARM", "5")
3992-
}, func() {
3993-
tg.setenv("GOARM", "7")
3994-
}))
3995-
}
3996-
39973958
func TestListTests(t *testing.T) {
39983959
tooSlow(t)
39993960
var tg *testgoData
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Issue 9737: verify that GOARM and GO386 affect the computed build ID
2+
3+
[short] skip
4+
5+
# 386
6+
cd $GOPATH/src/mycmd
7+
env GOOS=linux
8+
env GOARCH=386
9+
env GO386=387
10+
go install mycmd
11+
env GO386=sse2
12+
stale mycmd
13+
14+
# arm
15+
cd $GOPATH/src/mycmd
16+
env GOOS=linux
17+
env GOARCH=arm
18+
env GOARM=5
19+
go install mycmd
20+
env GOARM=7
21+
stale mycmd
22+
23+
24+
-- mycmd/x.go --
25+
package main
26+
27+
func main() {}

0 commit comments

Comments
 (0)