Commit 3c514bfe authored by Elias Pipping's avatar Elias Pipping

Fix test-run-program on windows

We cannot use `exit` on Windows with :force-shell nil (it's a builtin);
use `cmd /c exit` instead.

Using `exit` on Unix with :force-shell nil may or may not work (it's a
builtin but CL implementations typically invoke a shell anyway).
`true` and `false` are guaranteed to exist by the POSIX standard.
parent 79ec789a
......@@ -42,10 +42,18 @@
(DBG "Testing exit status with :output :interactive")
;; This test checks for a problem there was in allegro -- :output :interactive
;; would try to open T as a stream for INPUT.
(assert-equal '(nil nil 0) (multiple-value-list (run-program "exit 0" :force-shell t :output :interactive)))
(assert-equal '(nil nil 0) (multiple-value-list (run-program "exit 0" :force-shell nil :output :interactive)))
(assert-equal '(nil nil 1) (multiple-value-list (run-program "exit 1" :force-shell t :output :interactive :ignore-error-status t)))
(assert-equal '(nil nil 1) (multiple-value-list (run-program "exit 1" :force-shell nil :output :interactive :ignore-error-status t)))
:for (program . exit-code) :in
#+os-unix '(("true" . 0) ("false" . 1))
#+os-windows '(("cmd /c exit 0" . 0) ("cmd /c exit 1" . 1))
:do (loop
:for force-shell :in '(t nil)
:do (assert-equal `(nil nil ,exit-code)
(run-program program
:ignore-error-status t
:force-shell force-shell
:output :interactive)))))
'("foo" "bar baz" 42)
(multiple-value-bind (o e c)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment