diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2019-11-08 09:25:51 +0100 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2019-11-09 19:25:46 +0000 |
| commit | 6e111956ab4849976f9dcf46ecac575fa8105268 (patch) | |
| tree | 541ef87b27d85e029152a54055302e5c87474087 /src/syscall/syscall_linux_test.go | |
| parent | a0262b201f6d66142ae1e01723430a2471799404 (diff) | |
| download | go-6e111956ab4849976f9dcf46ecac575fa8105268.tar.xz | |
syscall: skip TestSyscallNoError on mips{,le}
On MIPS, Linux returns whether the syscall had an error in a separate
register (R7), not using a negative return value as on other
architectures. Thus, skip TestSyscallNoError as there is no error case
for syscall.RawSyscall which it could test against.
Also reformat the error output so the expected and gotten values are
aligned so they're easier to compare.
Fixes #35422
Change-Id: Ibc88f7c5382bb7ee8faf15ad4589ca1f9f017a06
Reviewed-on: https://go-review.googlesource.com/c/go/+/205898
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/syscall/syscall_linux_test.go')
| -rw-r--r-- | src/syscall/syscall_linux_test.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/syscall/syscall_linux_test.go b/src/syscall/syscall_linux_test.go index 8a578639bd..e30a10b870 100644 --- a/src/syscall/syscall_linux_test.go +++ b/src/syscall/syscall_linux_test.go @@ -299,6 +299,14 @@ func TestSyscallNoError(t *testing.T) { t.Skip("skipping on non-32bit architecture") } + // See https://golang.org/issue/35422 + // On MIPS, Linux returns whether the syscall had an error in a separate + // register (R7), not using a negative return value as on other + // architectures. + if runtime.GOARCH == "mips" || runtime.GOARCH == "mipsle" { + t.Skipf("skipping on %s", runtime.GOARCH) + } + if os.Getuid() != 0 { t.Skip("skipping root only test") } @@ -363,7 +371,8 @@ func TestSyscallNoError(t *testing.T) { if filesystemIsNoSUID(tmpBinary) { t.Skip("skipping test when temp dir is mounted nosuid") } - t.Errorf("expected %s, got %s", want, got) + // formatted so the values are aligned for easier comparison + t.Errorf("expected %s,\ngot %s", want, got) } } |
