Skip to content

Commit

Permalink
cmd/go: convert TestIssue12096 to the script framework
Browse files Browse the repository at this point in the history
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I27e52c4eabfcd1782965f17c098719dd0ea7e3ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/214390
Reviewed-by: Jay Conrod <[email protected]>
  • Loading branch information
matloob committed Feb 19, 2020
1 parent ea38df0 commit 2f2e97c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/cmd/go/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2189,21 +2189,6 @@ func TestIssue11709(t *testing.T) {
tg.run("run", tg.path("run.go"))
}

func TestIssue12096(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
tg.tempFile("test_test.go", `
package main
import ("os"; "testing")
func TestEnv(t *testing.T) {
if os.Getenv("TERM") != "" {
t.Fatal("TERM is set")
}
}`)
tg.unsetenv("TERM")
tg.run("test", tg.path("test_test.go"))
}

func TestGoBuildARM(t *testing.T) {
if testing.Short() {
t.Skip("skipping cross-compile in short mode")
Expand Down
15 changes: 15 additions & 0 deletions src/cmd/go/testdata/script/test_env_term.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Tests golang.org/issue/12096

env TERM=''
go test test_test.go
! stdout '^ok.*\[no tests to run\]'
stdout '^ok'

-- test_test.go --
package main
import ("os"; "testing")
func TestEnv(t *testing.T) {
if os.Getenv("TERM") != "" {
t.Fatal("TERM is set")
}
}

0 comments on commit 2f2e97c

Please sign in to comment.