test-all.lisp 3.13 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
(in-package :asdf-tools)

(defun call-with-all-lisps (thunk &optional (lisps *test-lisps*))
  (apply 'all-pass
         (loop :for lisp :in lisps
               :collect (let ((*test-lisps* (list lisp))) (funcall thunk)))))

(defmacro with-all-lisps ((&rest maybe-lisps) &body body)
  `(call-with-all-lisps (lambda () ,@body) ,@maybe-lisps))

(deftestcmd test-all-clean-load ()
  "test that all lisp implementations can load asdf cleanly without any output message"
  (with-all-lisps () (test-clean-load)))

(deftestcmd test-all-lisp ()
  "test that all lisp implementations pass all asdf test scripts"
  (with-all-lisps () (test-scripts)))

(deftestcmd test-all-no-upgrade ()
  "test that all lisp implementations pass all normal asdf; also test-basic"
  (all-pass (test-basic) (test-all-lisp)))

(deftestcmd test-all-upgrade ()
  "test that all lisp implementations pass all asdf upgrade tests"
  (with-all-lisps (*upgrade-test-lisps*) (test-upgrade)))

(deftestcmd test-all-lisps ()
  "test that all lisp implementations pass all asdf tests"
  (all-pass (test-all-no-upgrade) (test-all-upgrade)))
(defalias test-all test-all-lisps)

(deftestcmd test-all-lisp-no-stop ()
  "test that all lisp implementations pass all asdf test scripts, but don't stop on error"
  (with-all-lisps ()
    (ignore-errors (test-scripts))))

(deftestcmd test-all-upgrade-no-stop ()
  "test that all lisp implementations pass all asdf upgrade tests, but don't stop on error"
  (with-all-lisps (*upgrade-test-lisps*)
    (ignore-errors (test-upgrade))))

(deftestcmd test-all-no-upgrade-no-stop ()
  "test that all lisp implementations pass all normal asdf tests (no upgrade), but don't stop on error."
  (all-pass
   (test-basic)
   (test-all-clean-load)
   (test-all-lisp-no-stop)
   (check-all-test-results)))

(deftestcmd test-all-no-stop ()
  "test that all lisp implementations pass all asdf tests (including upgrade), but don't stop on error."
  (all-pass
   (test-basic)
   (test-all-clean-load)
   (test-all-lisp-no-stop)
   (test-all-upgrade-no-stop)
   (check-all-results)))

(deftestcmd check-all-test-results ()
  "were there errors in test scripts?"
  (with-asdf-dir ()
    (let ((a (run/lines
              `(grep "-L" "[5-9][0-9] passing and 0 failing"
                     ,(mapcar (lambda (l) (format nil "build/results/~(~A~)-test.text" l))
                              *test-lisps*)))))
      (or (null a)
          (progn
            (format! *error-output* "Unexpected test failures on these implementations:~%~{~A~%~}" a)
            nil)))))

(deftestcmd check-all-upgrade-results ()
  "were there upgrade tests failures?"
  (with-asdf-dir ()
    (let ((a (run/lines
              `(grep "-L" "Upgrade test succeeded for "
                     ,(mapcar (lambda (l) (format nil "build/results/~(~A~)-upgrade.text" l))
                              *upgrade-test-lisps*)))))
      (or (null a)
          (progn
            (format t "Unexpected upgrade failures on these implementations:~%~{~A~%~}~%" a)
            nil)))))

(deftestcmd check-all-results ()
  "check that there were no errors in either test scripts or upgrade tests"
  (all-pass (check-all-test-results) (check-all-upgrade-results)))