]> Cypherpunks repositories - gostls13.git/commitdiff
os/exec: pass ExitCode tests on Plan 9
authorFazlul Shahriar <fshahriar@gmail.com>
Tue, 28 Aug 2018 13:55:43 +0000 (09:55 -0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 28 Aug 2018 14:10:31 +0000 (14:10 +0000)
Fixes #27294

Change-Id: I8db5ca0f0c690bf532d3d33b8ed7d2633ad1702b
Reviewed-on: https://go-review.googlesource.com/131855
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/os/exec/exec_test.go

index f0bba11c5a38a2d340e3c8920b212864258460f0..558345ff632c956ae26a7e665a0d4a6acfdf5c62 100644 (file)
@@ -173,6 +173,9 @@ func TestExitCode(t *testing.T) {
        cmd := helperCommand(t, "exit", "42")
        cmd.Run()
        want := 42
+       if runtime.GOOS == "plan9" {
+               want = 1
+       }
        got := cmd.ProcessState.ExitCode()
        if want != got {
                t.Errorf("ExitCode got %d, want %d", got, want)
@@ -181,6 +184,9 @@ func TestExitCode(t *testing.T) {
        cmd = helperCommand(t, "/no-exist-executable")
        cmd.Run()
        want = 2
+       if runtime.GOOS == "plan9" {
+               want = 1
+       }
        got = cmd.ProcessState.ExitCode()
        if want != got {
                t.Errorf("ExitCode got %d, want %d", got, want)
@@ -189,6 +195,9 @@ func TestExitCode(t *testing.T) {
        cmd = helperCommand(t, "exit", "255")
        cmd.Run()
        want = 255
+       if runtime.GOOS == "plan9" {
+               want = 1
+       }
        got = cmd.ProcessState.ExitCode()
        if want != got {
                t.Errorf("ExitCode got %d, want %d", got, want)