Commit 5c9726e5 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Don't use :interactive in test-program, it can really suck on LispWorks / Windows.

Instead, refactor how we call make-hello-world.
parent 18bcccf8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -10,6 +10,11 @@

(asdf-test::frob-packages)

(println "This is make-hello-world, testing its standard-output.") ; *standard-output*
(println "This is make-hello-world, testing its error-output." *error-output*)
(println "This is make-hello-world, testing its stdout." *stdout*)
(println "This is make-hello-world, testing its stderr." *stderr*)

#+mkcl
(defun add-mkcl-dll (pathname)
  ;; make sure mkcl-X.X.X.dll is the same directory as the executable
+16 −19
Original line number Diff line number Diff line
@@ -28,20 +28,26 @@
;; Disable any user source registry.
(initialize-source-registry `(:source-registry :ignore-inherited-configuration))

(DBG "test image-op")
(defparameter img (output-file (make-operation 'image-op) (find-system :hello-world-example)))
(assert (absolute-pathname-p img))
(delete-file-if-exists img)
(DBG "- first create an executable image")
(defun make-hello-world (kind)
  (assert-equal
   0
   (nth-value 2
    (run-program
   (symbol-call :lisp-invocation :lisp-invocation-arglist
     (symbol-call
      #+allegro :lisp-path #+allegro *lisp*
      :lisp-invocation :lisp-invocation-arglist
      :load (native-namestring (subpathname *test-directory* "make-hello-world.lisp"))
                :eval "(asdf-test::make-hello-image)")
   :output :interactive :error-output :interactive :input nil))
 0)
      :eval (format nil "(asdf-test::make-hello-~a)" kind))
     :input nil :ignore-error-status t
     :output (list *standard-output* :linewise t :prefix "stdout: ")
     :error-output (list *error-output* :linewise t :prefix "stderr: ")))))

(DBG "test image-op")
(defparameter img (output-file (make-operation 'image-op) (find-system :hello-world-example)))
(assert (absolute-pathname-p img))
(delete-file-if-exists img)
(DBG "- first create an executable image")
(make-hello-world 'image)
(assert (probe-file* img) () "Can't find image file ~S" img)

(DBG "- then, use it")
@@ -85,16 +91,7 @@
(assert (absolute-pathname-p exe))
(delete-file-if-exists exe)
(DBG "- first, create the standalone program")
(assert-equal
 (nth-value 2
  (run-program
   (symbol-call :lisp-invocation :lisp-invocation-arglist
                #+allegro :lisp-path #+allegro *lisp*
                :load (native-namestring (subpathname *test-directory* "make-hello-world.lisp"))
                :eval "(asdf-test::make-hello-program)")
   :output :interactive :error-output :interactive :input nil))
 0)

(make-hello-world 'program)
(assert (probe-file* exe) () "Can't find executable file ~S" exe)

(DBG "- use that")