]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix mod_gomodcache and generate_env TestScripts on Plan 9
authorFazlul Shahriar <fshahriar@gmail.com>
Mon, 15 Jun 2020 17:04:05 +0000 (13:04 -0400)
committerBryan C. Mills <bcmills@google.com>
Tue, 16 Jun 2020 21:19:08 +0000 (21:19 +0000)
Adjust these two tests for Plan 9,
which uses $path instead of $PATH,
and $home instead of $HOME.

Fixes #39599

Change-Id: Idba95e07d307e76f0f61acd904905b417c52d43a
Reviewed-on: https://go-review.googlesource.com/c/go/+/237941
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/go/testdata/script/generate_env.txt
src/cmd/go/testdata/script/mod_gomodcache.txt

index 0d3693fa33a521c8670ec7e51e40a25323bdd7f7..2df16633765fa92d3543d581c9094488bbcd8491 100644 (file)
@@ -1,7 +1,8 @@
 # Install an env command because Windows and plan9 don't have it.
 env GOBIN=$WORK/tmp/bin
 go install env.go
-env PATH=$GOBIN${:}$PATH
+[plan9] env path=$GOBIN${:}$path
+[!plan9] env PATH=$GOBIN${:}$PATH
 
 # Test generators have access to the environment
 go generate ./printenv.go
index 67a8f07b2ce1e41c1d6402bff2eaf3b12dff6474..b2143e2093989719a2d000b12c415b5030a6c97e 100644 (file)
@@ -24,7 +24,8 @@ grep '{"Version":"v1.0.0","Time":"2018-02-14T00:45:20Z"}' $GOPATH/pkg/mod/cache/
 
 # If neither GOMODCACHE or GOPATH are set, GOPATH defaults to the user's $HOME/go, so GOMODCACHE becomes $HOME/go/pkg/mod
 [windows] env USERPROFILE=$WORK/home # Ensure USERPROFILE is a valid path (rather than /no-home/ so we don't run into the logic that "uninfers" GOPATH in cmd/go/main.go
-[!windows] env HOME=$WORK/home
+[plan9] env home=$WORK/home
+[!windows] [!plan9] env HOME=$WORK/home
 env GOMODCACHE=
 env GOPATH=
 go env GOMODCACHE