This is a followup to CL 3676.
Rather than silently returning from the test, a pass,
use the Skip facility to mark the test as skipped.
Change-Id: I90d237e770150bf8d69f14fb09874e70894a7f86
Reviewed-on: https://go-review.googlesource.com/3682
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
t.Skipf("skipping on %s", runtime.GOOS)
}
RemoveAll("/_go_os_test")
- err := MkdirAll("/_go_os_test/dir", 0777)
+ const dir = "/go_os_test/dir"
+ err := MkdirAll(dir, 0777)
if err != nil {
pathErr, ok := err.(*PathError)
// common for users not to be able to write to /
if ok && (pathErr.Err == syscall.EACCES || pathErr.Err == syscall.EROFS) {
- return
+ t.Skipf("could not create %v: %v", dir, err)
}
t.Fatalf(`MkdirAll "/_go_os_test/dir": %v`, err)
}