file := file
name := strings.TrimSuffix(filepath.Base(file), ".txt")
t.Run(name, func(t *testing.T) {
- if strings.HasPrefix(name, "mod_") && runtime.GOOS == "windows" {
- // Windows is very unhappy about the module proxy.
- t.Skip("golang.org/issue/26457")
- }
t.Parallel()
ts := &testScript{t: t, name: name, file: file}
ts.setup()
start time.Time // time phase started
}
+var extraEnvKeys = []string{
+ "SYSTEMROOT", // must be preserved on Windows to find DLLs; golang.org/issue/25210
+}
+
// setup sets up the test execution temporary directory and environment.
func (ts *testScript) setup() {
StartProxy()
tempEnvName() + "=" + filepath.Join(ts.workdir, "tmp"),
"devnull=" + os.DevNull,
}
+
if runtime.GOOS == "windows" {
ts.env = append(ts.env, "exe=.exe")
} else {
ts.env = append(ts.env, "exe=")
}
+ for _, key := range extraEnvKeys {
+ if val := os.Getenv(key); val != "" {
+ ts.env = append(ts.env, key+"="+val)
+ }
+ }
+
ts.envMap = make(map[string]string)
for _, kv := range ts.env {
if i := strings.Index(kv, "="); i >= 0 {
! go get rsc.io/badfile1 rsc.io/badfile2 rsc.io/badfile3 rsc.io/badfile4 rsc.io/badfile5
! stderr 'unzip.*badfile1'
-stderr 'unzip.*badfile2/@v/v1.0.0.zip:.*malformed file path "☺.go": invalid char ''☺'''
-stderr 'unzip.*badfile3/@v/v1.0.0.zip: malformed file path "x\?y.go": invalid char ''\?'''
-stderr 'unzip.*badfile4/@v/v1.0.0.zip: case-insensitive file name collision: "x/Y.go" and "x/y.go"'
-stderr 'unzip.*badfile5/@v/v1.0.0.zip: case-insensitive file name collision: "x/y" and "x/Y"'
+stderr 'unzip.*badfile2[\\/]@v[\\/]v1.0.0.zip:.*malformed file path "☺.go": invalid char ''☺'''
+stderr 'unzip.*badfile3[\\/]@v[\\/]v1.0.0.zip: malformed file path "x\?y.go": invalid char ''\?'''
+stderr 'unzip.*badfile4[\\/]@v[\\/]v1.0.0.zip: case-insensitive file name collision: "x/Y.go" and "x/y.go"'
+stderr 'unzip.*badfile5[\\/]@v[\\/]v1.0.0.zip: case-insensitive file name collision: "x/y" and "x/Y"'
-- go.mod --
module x