Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testscript: some fixes for Plan 9 #115

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions testscript/testdata/evalsymlink.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# matcher will have problems with external programs that uses the real path.
# This script tests that $WORK is matched in a consistent way (also see #79).
[windows] skip
[plan9] skip
exec pwd
stdout ^$WORK$
exec pwd -P
Expand Down
4 changes: 2 additions & 2 deletions testscript/testdata/exec_path_change.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

[!exec:go] skip

env HOME=$WORK${/}home
env HOME=$WORK${slash}home
[windows] env USERPROFILE=$WORK\home
[windows] env LOCALAPPDATA=$WORK\appdata

cd go
exec go$exe version
stdout 'go version'
exec go$exe build
env PATH=$WORK${/}go${:}$PATH
env PATH=$WORK${slash}go${:}$PATH
exec go$exe version
stdout 'This is not go'

Expand Down
5 changes: 4 additions & 1 deletion testscript/testscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,17 @@ func (ts *TestScript) setup() string {
homeEnvName() + "=/no-home",
tempEnvName() + "=" + filepath.Join(ts.workdir, "tmp"),
"devnull=" + os.DevNull,
"/=" + string(os.PathSeparator),
"slash=" + string(os.PathSeparator),
":=" + string(os.PathListSeparator),
},
WorkDir: ts.workdir,
Values: make(map[interface{}]interface{}),
Cd: ts.workdir,
ts: ts,
}
if runtime.GOOS == "plan9" {
env.Vars = append(env.Vars, "path="+os.Getenv("path"))
}
// Must preserve SYSTEMROOT on Windows: https://github.com/golang/go/issues/25513 et al
if runtime.GOOS == "windows" {
env.Vars = append(env.Vars,
Expand Down