Skip to content

Commit 82c1a87

Browse files
matloobcagedmantis
authored andcommitted
[release-branch.go1.13] cmd/go: convert TestBuildIDContainsArchModeEnv to the script framework
Part of converting all tests to script framework to improve test parallelism. Fixes #39823 Updates #36320 Updates #17751 Change-Id: I69c69809fb1698c8198ef3ea00103a9acb7b6ce7 Reviewed-on: https://go-review.googlesource.com/c/go/+/214387 Run-TryBot: Michael Matloob <[email protected]> Reviewed-by: Jay Conrod <[email protected]> (cherry picked from CL 214387) Reviewed-on: https://go-review.googlesource.com/c/go/+/239777 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Michael Matloob <[email protected]> Reviewed-by: Carlos Amedee <[email protected]>
1 parent 206ee87 commit 82c1a87

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
@@ -4878,45 +4878,6 @@ func TestGoTestRaceCoverModeFailures(t *testing.T) {
48784878
tg.grepBothNot("PASS", "something passed")
48794879
}
48804880

4881-
// Issue 9737: verify that GOARM and GO386 affect the computed build ID.
4882-
func TestBuildIDContainsArchModeEnv(t *testing.T) {
4883-
if testing.Short() {
4884-
t.Skip("skipping in short mode")
4885-
}
4886-
4887-
var tg *testgoData
4888-
testWith := func(before, after func()) func(*testing.T) {
4889-
return func(t *testing.T) {
4890-
tg = testgo(t)
4891-
defer tg.cleanup()
4892-
tg.tempFile("src/mycmd/x.go", `package main
4893-
func main() {}`)
4894-
tg.setenv("GOPATH", tg.path("."))
4895-
4896-
tg.cd(tg.path("src/mycmd"))
4897-
tg.setenv("GOOS", "linux")
4898-
before()
4899-
tg.run("install", "mycmd")
4900-
after()
4901-
tg.wantStale("mycmd", "stale dependency", "should be stale after environment variable change")
4902-
}
4903-
}
4904-
4905-
t.Run("386", testWith(func() {
4906-
tg.setenv("GOARCH", "386")
4907-
tg.setenv("GO386", "387")
4908-
}, func() {
4909-
tg.setenv("GO386", "sse2")
4910-
}))
4911-
4912-
t.Run("arm", testWith(func() {
4913-
tg.setenv("GOARCH", "arm")
4914-
tg.setenv("GOARM", "5")
4915-
}, func() {
4916-
tg.setenv("GOARM", "7")
4917-
}))
4918-
}
4919-
49204881
func TestTestRegexps(t *testing.T) {
49214882
tg := testgo(t)
49224883
defer tg.cleanup()
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)