Skip to content

Commit

Permalink
cmd/go: convert TestRelativeGOBINFail to 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: I1cb3e2e28700b05b08933f4e24cd996268c1f163
Reviewed-on: https://go-review.googlesource.com/c/go/+/214428
Reviewed-by: Jay Conrod <[email protected]>
  • Loading branch information
matloob committed Feb 19, 2020
1 parent f4f7db4 commit 3457359
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/cmd/go/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1138,16 +1138,6 @@ func TestMSanAndRaceRequireCgo(t *testing.T) {
}
}

func TestRelativeGOBINFail(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
tg.tempFile("triv.go", `package main; func main() {}`)
tg.setenv("GOBIN", ".")
tg.cd(tg.path("."))
tg.runFail("install")
tg.grepStderr("cannot install, GOBIN must be an absolute path", "go install must fail if $GOBIN is a relative path")
}

func TestPackageMainTestCompilerFlags(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
Expand Down
8 changes: 8 additions & 0 deletions src/cmd/go/testdata/script/install_relative_gobin_fail.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
env GOBIN=.
! go install
stderr 'cannot install, GOBIN must be an absolute path'

-- triv.go --
package main

func main() {}

0 comments on commit 3457359

Please sign in to comment.