Commit 12acba0e authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Fix run-program on ccl/windows. More tweaks for allegro/windows.

parent 2f7e8f38
......@@ -141,6 +141,11 @@ do_tests () {
fi
}
case $(uname) in
CYGWIN*) os=windows ;;
*) os=unix ;;
esac
# terminate on error
set -e
......@@ -152,13 +157,15 @@ case "$lisp" in
eval="--eval" ;;
allegro)
command="${ALLEGRO:-alisp}"
#flags="-q"
flags="-q"
nodebug="-batch"
if [ "$os" = windows ] ; then nodebug="$nodebug +c" ; fi
eval="-e" ;;
allegromodern)
command="${ALLEGROMODERN:-mlisp}"
flags="-q"
nodebug="-batch"
if [ "$os" = windows ] ; then nodebug="$nodebug +c" ; fi
eval="-e" ;;
ccl)
command="${CCL:-ccl}"
......
......@@ -2,10 +2,10 @@
(declaim (optimize (debug 3) (safety 3)))
(DBG "Testing echo ok 1 via run-program as a list")
(assert-equal '("ok 1") (run-program '("echo" "ok" "1") :output :lines))
(assert-equal "ok 1" (run-program '("echo" "ok" "1") :output '(:string :stripped t)))
(DBG "Testing echo ok 1 via run-program as a string")
(assert-equal '("ok 1") (run-program "echo ok 1" :output :lines))
(assert-equal "ok 1" (run-program "echo ok 1" :output '(:string :stripped t)))
;; (unless (os-unix-p) (leave-test "The rest of this test is only supposed to work on Unix"))
......
......@@ -46,6 +46,20 @@
(setf excl:*warn-on-nested-reader-conditionals* nil))
(setf *print-readably* nil))
#+clozure
(in-package :ccl)
#+(and clozure windows-target)
(eval-when (:load-toplevel :compile-toplevel :execute)
(unless (fboundp 'external-process-wait)
(in-development-mode
(defun external-process-wait (proc)
(when (external-process-pid proc))
(with-interrupts-enabled
(wait-on-semaphore (external-process-completed proc)))))))
#+clozure
(in-package :uiop/common-lisp)
#+cormanlisp
(eval-when (:load-toplevel :compile-toplevel :execute)
(deftype logical-pathname () nil)
......
......@@ -560,7 +560,7 @@ It returns a process-info plist with possible keys:
(let ((process (getf process-info :process)))
(when process
;; 1- wait
#+(and clozure os-unix) (ccl::external-process-wait process)
#+clozure (ccl::external-process-wait process)
#+(or cmu scl) (ext:process-wait process)
#+(and ecl os-unix) (ext:external-process-wait process)
#+sbcl (sb-ext:process-wait process)
......
......@@ -364,13 +364,17 @@ Otherwise, using WRITE-SEQUENCE using a buffer of size BUFFER-SIZE."
(defun slurp-stream-lines (input &key count)
"Read the contents of the INPUT stream as a list of lines, return those lines.
Note: relies on the Lisp's READ-LINE, but additionally removes any remaining CR
from the line-ending if the file or stream had CR+LF but Lisp only removed LF.
Read no more than COUNT lines."
(check-type count (or null integer))
(with-open-stream (input input)
(loop :for n :from 0
:for l = (and (or (not count) (< n count))
(read-line input nil nil))
:while l :collect l)))
;; stripln: to remove CR when the OS sends CRLF and Lisp only remove LF
:while l :collect (stripln l))))
(defun slurp-stream-line (input &key (at 0))
"Read the contents of the INPUT stream as a list of lines,
......
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