aboutsummaryrefslogtreecommitdiff
path: root/src/path/filepath/path_test.go
diff options
context:
space:
mode:
authorDavid Crawshaw <crawshaw@golang.org>2015-02-28 22:55:29 -0500
committerDavid Crawshaw <crawshaw@golang.org>2015-03-01 18:38:21 +0000
commit5432b4d34616585ce5a1884aeecd0e902e1c2bff (patch)
tree5495ed19b34a5ea6932b4493e84e6072fdb91aca /src/path/filepath/path_test.go
parent5c2233f261b5088c35c67b00021b25156b9af96e (diff)
downloadgo-5432b4d34616585ce5a1884aeecd0e902e1c2bff.tar.xz
path/filepath: get tests working on darwin/arm
Change-Id: Ic44d7837aaec58601e5d9cad8da5b958a809f4a0 Reviewed-on: https://go-review.googlesource.com/6400 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/path/filepath/path_test.go')
-rw-r--r--src/path/filepath/path_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/path/filepath/path_test.go b/src/path/filepath/path_test.go
index 293d316124..aac7911d43 100644
--- a/src/path/filepath/path_test.go
+++ b/src/path/filepath/path_test.go
@@ -399,7 +399,31 @@ func mark(path string, info os.FileInfo, err error, errors *[]error, clear bool)
return nil
}
+func chtmpdir(t *testing.T) (restore func()) {
+ oldwd, err := os.Getwd()
+ if err != nil {
+ t.Fatal("chtmpdir: %v", err)
+ }
+ d, err := ioutil.TempDir("", "test")
+ if err != nil {
+ t.Fatal("chtmpdir: %v", err)
+ }
+ if err := os.Chdir(d); err != nil {
+ t.Fatal("chtmpdir: %v", err)
+ }
+ return func() {
+ if err := os.Chdir(oldwd); err != nil {
+ t.Fatal("chtmpdir: %v", err)
+ }
+ os.RemoveAll(d)
+ }
+}
+
func TestWalk(t *testing.T) {
+ if runtime.GOOS == "darwin" && runtime.GOARCH == "arm" {
+ restore := chtmpdir(t)
+ defer restore()
+ }
makeTree(t)
errors := make([]error, 0, 10)
clear := true
@@ -1009,6 +1033,9 @@ func TestDriveLetterInEvalSymlinks(t *testing.T) {
}
func TestBug3486(t *testing.T) { // http://golang.org/issue/3486
+ if runtime.GOOS == "darwin" && runtime.GOARCH == "arm" {
+ t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH)
+ }
root, err := filepath.EvalSymlinks(runtime.GOROOT() + "/test")
if err != nil {
t.Fatal(err)