Skip to content

Commit

Permalink
cmd/go: convert TestIssue11709 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: I16fb0910196c96caef6ed380f96010a548407f9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/214424
Reviewed-by: Bryan C. Mills <[email protected]>
  • Loading branch information
matloob committed Feb 19, 2020
1 parent 635f4b9 commit e5f5607
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 @@ -2174,21 +2174,6 @@ func TestGoBuildGOPATHOrderBroken(t *testing.T) {
tg.run("install", "-x", "bar")
}

func TestIssue11709(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
tg.tempFile("run.go", `
package main
import "os"
func main() {
if os.Getenv("TERM") != "" {
os.Exit(1)
}
}`)
tg.unsetenv("TERM")
tg.run("run", tg.path("run.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/run_issue11709.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 'go run' should not pass extraneous environment variables to the subprocess.
go run run.go
! stdout .
! stderr .

-- run.go --
package main

import "os"

func main() {
if os.Getenv("TERM") != "" {
os.Exit(1)
}
}

0 comments on commit e5f5607

Please sign in to comment.