]> Cypherpunks repositories - gostls13.git/commitdiff
os/user: skip Current test on android
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 8 Mar 2016 15:58:20 +0000 (15:58 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 8 Mar 2016 17:28:13 +0000 (17:28 +0000)
Also, add more failure output to debug why linux/mips64le and
linux/ppc64 are failing. They should be working. I suspect their
builder test envs are missing something.

Change-Id: I97273fe72c4e3009db400394636d0da1ef147485
Reviewed-on: https://go-review.googlesource.com/20358
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/os/user/lookup_stubs.go
src/os/user/user_test.go

index 7ff4829516fed461012a918d0d4928e334734482..ebf24f79deeb896bbc505c1cf2c0639c87f0675a 100644 (file)
@@ -43,7 +43,7 @@ func current() (*User, error) {
        if u.Uid != "" && u.Username != "" && u.HomeDir != "" {
                return u, nil
        }
-       return nil, fmt.Errorf("user: Current not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
+       return u, fmt.Errorf("user: Current not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
 }
 
 func lookupUser(username string) (*User, error) {
index 122051d9596f8ae5aebe4f97dd73c0220baa6e46..222b33954465ef2b5dfd55c39cd1abe8440e9d8f 100644 (file)
@@ -16,9 +16,12 @@ func checkUser(t *testing.T) {
 }
 
 func TestCurrent(t *testing.T) {
+       if runtime.GOOS == "android" {
+               t.Skipf("skipping on %s", runtime.GOOS)
+       }
        u, err := Current()
        if err != nil {
-               t.Fatalf("Current: %v", err)
+               t.Fatalf("Current: %v (got %#v)", err, u)
        }
        if u.HomeDir == "" {
                t.Errorf("didn't get a HomeDir")