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

Test image-op. Add missing implementation method (oops).

parent b80f6659
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -170,10 +170,11 @@ itself.")) ;; operation on a system and its dependencies
    (bundle-output-files o c))

  #-(or ecl mkcl)
  (defmethod perform ((o program-op) (c system))
    (let ((output-file (output-file o c)))
      (setf *image-entry-point* (ensure-function (component-entry-point c)))
      (dump-image output-file :executable t)))
  (progn
    (defmethod perform ((o image-op) (c system))
      (dump-image (output-file o c) :executable (typep o 'program-op)))
    (defmethod perform :before ((o program-op) (c system))
      (setf *image-entry-point* (ensure-function (component-entry-point c)))))

  (defclass compiled-file (file-component)
    ((type :initform #-(or ecl mkcl) (compile-file-type) #+(or ecl mkcl) "fasb")))
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

#-mkcl
(defsystem :hello-world-example
  :build-operation program-op
  ;; :build-operation program-op ; this would cause the executable output in same directory :-/
  :entry-point "hello:entry-point"
  :depends-on (:uiop)
  :components ((:file "hello")))
+16 −4
Original line number Diff line number Diff line
@@ -10,8 +10,20 @@

(asdf-test::frob-packages)

(with-test ()
  ;;(dolist (s '(:asdf :uiop :asdf/defsystem :uiop)) (DBG :foo s (asdf::builtin-system-p (find-system s))))
  ;;(trace perform-plan perform)
(dolist (s '(:asdf :uiop :asdf/defsystem :uiop))
  (assert (asdf::builtin-system-p (find-system s)) () "System ~A not builtin(!)" s))

(defun make-hello-image ()
  (operate 'load-fasl-op :hello-world-example)
  (operate 'image-op :hello-world-example))

(defun make-hello-program ()
  (operate 'load-fasl-op :hello-world-example)
  (operate 'program-op :hello-world-example))
  (operate 'program-op :hello-world-example)
  #+(and mkcl windows) ;; make sure mkcl-X.X.X.dll is the same directory as the executable
  (let* ((dll-orig (subpathname (si::self-truename)
                                (strcat "mkcl_" (lisp-implementation-version) ".dll")))
         (exe (asdf::output-file 'program-op :hello-world-example))
         (dll-dest (subpathname exe dll-orig)))
    (copy-file dll-orig dll-dest)))
+5 −5
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ do_tests () {
      echo "Testing: $i" >&2
      test_count=`expr "$test_count" + 1`
      rm -f ~/.cache/common-lisp/"`pwd`"/* || true
      if DO $bcmd $eval "'(#.(load(string'|script-support.lisp|))#.(asdf-test::load-asdf)#.(asdf-test::frob-packages)#.(asdf-test::with-test()(load(string'|$i|))))" ; then
      if DO $bcmd $eval "'(#.(load(string'|script-support.lisp|))#.(asdf-test::load-asdf)#.(asdf-test::frob-packages)#.(asdf-test:run-test-script'|$i|))" ; then
        echo "Using $command, $i passed" >&2
	test_pass=`expr "$test_pass" + 1`
      else
@@ -476,10 +476,10 @@ test_clean_load () {
    nop=build/results/${lisp}-nop.text
    load=build/results/${lisp}-load.text
    $bcmd $eval \
      "(or'#.(load(string'|test/script-support.lisp|):verbose():print())#.(asdf-test::exit-lisp'0))" \
      "(or'#.(load(string'|test/script-support.lisp|):verbose():print())#.(asdf-test:exit-lisp'0))" \
      > $nop 2>&1
    $bcmd $eval \
      "(or'#.(load(string'|test/script-support.lisp|):verbose():print())#.(asdf-test::verbose())#.(load(string'|build/asdf.lisp|):verbose())#.(asdf/image:quit'0))" \
      "(or'#.(load(string'|test/script-support.lisp|):verbose():print())#.(asdf-test:verbose())#.(load(string'|build/asdf.lisp|):verbose())#.(asdf/image:quit'0))" \
      > $load 2>&1
    if diff $nop $load ; then
      echo "GOOD: Loading ASDF on $lisp produces no message" >&2 ; return 0
@@ -492,13 +492,13 @@ test_load_systems () {
    mkdir -p build/results/
    echo "Loading all these systems: $*"
    $bcmd $eval \
      "(or #.(load(string'|test/script-support.lisp|))#.(asdf-test::with-test()(asdf-test::test-load-systems $*)))" \
      "(or #.(load(string'|test/script-support.lisp|))#.(asdf-test:with-test()(asdf-test:test-load-systems $*)))" \
        2>&1 | tee build/results/${lisp}-systems.text
}
test_interactively () {
    cd ${ASDFDIR}
    mkdir -p build/results/
    rlwrap $icmd $eval "(or'#.(load(string'|test/script-support.lisp|))#.(asdf-test::interactive-test'($*)))"
    rlwrap $icmd $eval "(or'#.(load(string'|test/script-support.lisp|))#.(asdf-test:interactive-test'($*)))"
}

if [ -z "$command" ] ; then
+8 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ Some constraints:
   #:load-asdf-system #:clean-load-asdf-system
   #:register-directory #:load-test-system
   #:with-test #:test-asdf #:debug-asdf
   #:run-test-script #:interactive-test
   #:verbose #:exit-lisp
   #:assert-compare
   #:assert-equal
   #:leave-test #:def-test-system
@@ -357,6 +359,12 @@ is bound, write a message and exit on an error. If
  (setf *package* (some 'find-package '(:asdf :uiop :asdf/utility :asdf/package :asdf-test)))
  (load "contrib/debug.lisp"))

(defun run-test-script (file)
  (with-test ()
    (let ((name (string file)))
      (format t "Running ~A with ~A~%" name (acall :implementation-identifier))
      (load name))))

(defun load-asdf-lisp (&optional tag)
  (quietly (load (asdf-lisp tag) :verbose *load-verbose* :print *load-print*)))

Loading