test-bundle.script 1.6 KB
Newer Older
1 2 3 4 5 6 7 8
;;; -*- Lisp -*-
(load "script-support.lisp")
(load-asdf)

;;;---------------------------------------------------------------------------
;;; Check to see if the bundle functionality is doing something.
;;;---------------------------------------------------------------------------

9
(with-test ()
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
  (asdf:initialize-source-registry '(:source-registry :ignore-inherited-configuration))
  (asdf:clear-system :test-bundle-1)
  (asdf:clear-system :test-bundle-2)
  (when (find-package :test-package) (delete-package :test-package))
  (eval `(def-test-system :test-bundle-1
           :pathname ,*test-directory*
           :components ((:file "file1") (:file "file3"))))
  (eval `(def-test-system :test-bundle-2
           :pathname ,*test-directory*
           :depends-on (:test-bundle-1) :components ((:file "file2"))))
  #-(or abcl (and ecl ecl-bytecmp) gcl)
  (let* ((op (make-instance 'asdf::fasl-op))
         (bundle-1 (asdf:output-file op (find-system :test-bundle-1)))
         (bundle-2 (asdf:output-file op (find-system :test-bundle-2))))
    (DBG :test-bundle bundle-1 bundle-2)
25 26
    (assert-equal (list bundle-2)
                  (input-files (make-operation 'load-fasl-op) (find-system :test-bundle-2)))
27 28 29
    (delete-file-if-exists bundle-1)
    (delete-file-if-exists bundle-2)
    (operate 'load-fasl-op :test-bundle-2)
30 31
    ;; Check that the bundles were indeed created.
    (assert (probe-file bundle-2))
32
    (assert (probe-file bundle-1))
33
    ;; Check that the files were indeed loaded.
34 35
    (assert (symbol-value (find-symbol* :*file1* :test-package)))
    (assert (symbol-value (find-symbol* :*file3* :test-package)))))