]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: convert TestRelativeGOBINFail to script framework
authorMichael Matloob <matloob@golang.org>
Mon, 13 Jan 2020 16:24:06 +0000 (11:24 -0500)
committerMichael Matloob <matloob@golang.org>
Wed, 19 Feb 2020 22:04:41 +0000 (22:04 +0000)
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 <jayconrod@google.com>
src/cmd/go/go_test.go
src/cmd/go/testdata/script/install_relative_gobin_fail.txt [new file with mode: 0644]

index afedcb816d81fad7a2fcd201639aa041ad095d73..9da94360f9ffb9ff6287d0c9ca77ea29aff5b170 100644 (file)
@@ -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()
diff --git a/src/cmd/go/testdata/script/install_relative_gobin_fail.txt b/src/cmd/go/testdata/script/install_relative_gobin_fail.txt
new file mode 100644 (file)
index 0000000..e1e9ec7
--- /dev/null
@@ -0,0 +1,8 @@
+env GOBIN=.
+! go install
+stderr 'cannot install, GOBIN must be an absolute path'
+
+-- triv.go --
+package main
+
+func main() {}
\ No newline at end of file