From: Fazlul Shahriar Date: Tue, 28 Aug 2018 13:55:43 +0000 (-0400) Subject: os/exec: pass ExitCode tests on Plan 9 X-Git-Tag: go1.12beta1~1242 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2e234754d7aee07eb00c7133a331e96a75517f9e;p=gostls13.git os/exec: pass ExitCode tests on Plan 9 Fixes #27294 Change-Id: I8db5ca0f0c690bf532d3d33b8ed7d2633ad1702b Reviewed-on: https://go-review.googlesource.com/131855 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index f0bba11c5a..558345ff63 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -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)