Skip to content

Commit 3791594

Browse files
committed
cmd/go: convert TestBuildIDContainsArchModeEnv to the script framework
Part of converting all tests to script framework to improve test parallelism. 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]>
1 parent 1e43298 commit 3791594

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
@@ -2642,45 +2642,6 @@ func TestNeedVersion(t *testing.T) {
26422642
tg.grepStderr("compile", "does not match go tool version")
26432643
}
26442644

2645-
// Issue 9737: verify that GOARM and GO386 affect the computed build ID.
2646-
func TestBuildIDContainsArchModeEnv(t *testing.T) {
2647-
if testing.Short() {
2648-
t.Skip("skipping in short mode")
2649-
}
2650-
2651-
var tg *testgoData
2652-
testWith := func(before, after func()) func(*testing.T) {
2653-
return func(t *testing.T) {
2654-
tg = testgo(t)
2655-
defer tg.cleanup()
2656-
tg.tempFile("src/mycmd/x.go", `package main
2657-
func main() {}`)
2658-
tg.setenv("GOPATH", tg.path("."))
2659-
2660-
tg.cd(tg.path("src/mycmd"))
2661-
tg.setenv("GOOS", "linux")
2662-
before()
2663-
tg.run("install", "mycmd")
2664-
after()
2665-
tg.wantStale("mycmd", "stale dependency", "should be stale after environment variable change")
2666-
}
2667-
}
2668-
2669-
t.Run("386", testWith(func() {
2670-
tg.setenv("GOARCH", "386")
2671-
tg.setenv("GO386", "387")
2672-
}, func() {
2673-
tg.setenv("GO386", "sse2")
2674-
}))
2675-
2676-
t.Run("arm", testWith(func() {
2677-
tg.setenv("GOARCH", "arm")
2678-
tg.setenv("GOARM", "5")
2679-
}, func() {
2680-
tg.setenv("GOARM", "7")
2681-
}))
2682-
}
2683-
26842645
func TestBuildmodePIE(t *testing.T) {
26852646
if testing.Short() && testenv.Builder() == "" {
26862647
t.Skipf("skipping in -short mode on non-builder")
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)