test-basic.lisp 2.52 KB
Newer Older
1 2 3
(in-package :asdf-tools)

(deftestcmd %load (lisp) ;; load would be a clash, so use %load instead
4 5 6
  "load asdf into an interactive Lisp for debugging
load from individual source files, to make it easier to quickly locate
compilation errors and to interactively debug ASDF."
7 8 9 10 11 12 13 14 15
  (with-asdf-dir ()
    (run-test-lisp
     (format nil "loading ASDF into an interactive ~(~A~)" lisp)
     `((load "test/script-support.lisp")
       (asdf-test::interactive-test
        ',(system-source-files :asdf/defsystem :monolithic t)))
     :lisp lisp :debugger t :output :interactive)))

(deftestcmd test-load-systems (lisp systems)
16 17
  "test loading of your favorite systems
Use your preferred Lisp implementation"
18 19 20 21 22 23 24 25 26 27
  (with-asdf-dir ()
    (let* ((log (newlogfile "systems" lisp)))
      (log! log "Loading all these systems on ~(~A~):~{~%  ~A~}~%~%" lisp systems)
      (run-test-lisp
       "loading the systems"
       `((load "test/script-support.lisp")
         (asdf-test::with-test () (asdf-test::test-load-systems ,@systems)))
       :lisp lisp :log log))))

(deftestcmd test-clean-load (lisp log)
28 29
  "test that asdf load cleanly
Use your preferred lisp implementation and check that asdf is loaded without any output message"
30 31 32 33 34 35 36
  (nest
   (block ()
     (case lisp ((:gcl :cmucl) (return t)))) ;; These are hopeless
   (with-asdf-dir ())
   (let ((nop (newlogfile "nop" lisp))
         (load (newlogfile "load" lisp)))
     (run-test-lisp
37
      (format nil "starting ~(~A~), loading the script support, and exiting without doing anything" lisp)
38 39 40 41
      `((load "test/script-support.lisp" :verbose nil :print nil)
        (asdf-test::exit-lisp 0))
      :lisp lisp :output nop :log log)
     (run-test-lisp
42
      (format nil "starting ~(~A~), loading the script support, loading ASDF from source, then exiting" lisp)
43
      `((load "test/script-support.lisp" :verbose nil :print nil)
44
        (asdf-test::verbose nil)
45
        (load "build/asdf.lisp" :verbose nil :print nil)
46
        (uiop/image:quit 0))
47 48 49 50 51
      :lisp lisp :output load :log log)
     (if (nth-value 2 (run `(diff ,nop ,load)
                           :output :interactive :error-output :output :input nil))
         (progn
           (log! log "GOOD: Loading ASDF on ~(~A~) produces no message" lisp)
52
           (return (success)))
53 54 55 56 57
         (progn
           (log! log "BAD: Loading ASDF on ~(~A~) produces messages" lisp)
           (return nil))))))

(deftestcmd test-basic (lisp systems)
58
  "basic test: doc, clean-load, load-systems"
59 60 61 62
  (without-stopping ()
    (doc)
    (test-clean-load lisp)
    (test-load-systems lisp systems)))