test-all.lisp 2.79 KB
Newer Older
1 2 3 4
(in-package :asdf-tools)

(defun call-with-all-lisps (thunk &optional (lisps *test-lisps*))
  (apply 'all-pass
5 6
         (loop :for lisp :in (get-lisps lisps)
               :collect (funcall thunk lisp))))
7

8 9
(defmacro with-all-lisps ((&optional (lisp-var 'lisp) (lisps '*test-lisps*)) &body body)
  `(call-with-all-lisps (lambda (,lisp-var) ,@body) ,lisps))
10

11
(deftestcmd test-all-clean-load (lisps)
12
  "test-clean-load on all lisps"
13
  (with-all-lisps (l lisps) (test-clean-load l)))
14

15
(deftestcmd test-all-scripts (lisps)
16
  "test-scripts on all lisps"
17
  (with-all-lisps (l lisps) (test-scripts l)))
18 19

(deftestcmd test-all-no-upgrade ()
20 21
  "test-basic, and test-all-script"
  (all-pass (test-basic) (test-all-scripts)))
22

23
(deftestcmd test-all-upgrade (upgrade-lisps)
24
  "test-upgrade on all lisps"
25
  (with-all-lisps (l upgrade-lisps) (test-upgrade l)))
26

27 28
(deftestcmd test-all ()
  "all tests"
29 30
  (all-pass (test-all-no-upgrade) (test-all-upgrade)))

31
(deftestcmd test-all-scripts-no-stop (lisps)
32
  "test-scripts on all lisps, no stop"
33
  (with-all-lisps (l lisps) (ignore-errors (test-scripts l))))
34

35
(deftestcmd test-all-upgrade-no-stop (upgrade-lisps)
36
  "test-upgrade on all lisps, no stop"
37
  (with-all-lisps (l upgrade-lisps) (ignore-errors (test-upgrade l))))
38 39

(deftestcmd test-all-no-upgrade-no-stop ()
40
  "all tests but upgrade on all lisps, no stop"
41
  (all-pass
42
   (doc) (test-load-systems)
43
   (test-all-clean-load)
44 45
   (test-all-scripts-no-stop)
   (check-all-scripts-results)))
46

47
(deftestcmd test-all-no-stop () ;; TODO: pass arguments!
48
  "all tests on all lisps, no stop"
49
  (all-pass
50
   (doc) (test-load-systems)
51
   (test-all-clean-load)
52
   (test-all-scripts-no-stop)
53 54 55
   (test-all-upgrade-no-stop)
   (check-all-results)))

56
(deftestcmd check-all-scripts-results ()
57 58 59 60 61 62
  "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*)))))
63
      (if (null a) (success)
64 65 66 67 68
          (progn
            (format! *error-output* "Unexpected test failures on these implementations:~%~{~A~%~}" a)
            nil)))))

(deftestcmd check-all-upgrade-results ()
69
  "were there upgrade test failures?"
70 71 72 73 74
  (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*)))))
75
      (if (null a) (success)
76 77 78 79 80
          (progn
            (format t "Unexpected upgrade failures on these implementations:~%~{~A~%~}~%" a)
            nil)))))

(deftestcmd check-all-results ()
81
  "were there failures in any scripts or upgrade?"
82
  (all-pass (check-all-scripts-results) (check-all-upgrade-results)))
83