build.lisp 1.46 KB
Newer Older
1 2
(in-package :asdf-tools)

3
(deftestcmd build-asdf ()
4
  "make sure asdf.lisp is built"
5 6 7 8 9
  (load-system :asdf)
  (success))

(deftestcmd build-asdf-tools ()
  "build a binary for asdf-tools"
10
  (asdf:operate :program-op :asdf-tools)
11
  (success))
12 13

;;; Documentation
14
(deftestcmd doc ()
15
  "build documentation in doc/ directory"
16
  (with-failure-context (:name "in doc/ directory")
17
    (run* '(make) :directory (pn "doc/"))))
18

19
(deftestcmd website ()
20
  "publish documentation onto the public website"
21
  (with-failure-context (:name "in doc/ directory")
22
    (run* '(make website) :directory (pn "doc/"))))
23 24 25


;;; Line counting
26
(deftestcmd wc ()
27
  "count lines of lisp code in asdf and uiop"
28
  (with-asdf-dir ()
29
    (flet ((lisp-only (x) (remove "lisp" x :test-not 'equal :key 'pathname-type)))
30
      (let ((uiop-files (mapcar #'(lambda (x) (subpathname "uiop/" x)) (lisp-only (uiop-files))))
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
31 32
            (defsystem-files (remove "build/asdf.lisp"
                                     (lisp-only (asdf-defsystem-files)) :test 'equal)))
33
        (run* `(pipe (wc ,@uiop-files) (sort -n)))
34
        (terpri)
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
35
        (run* `(pipe (wc ,@defsystem-files) (sort -n)))
36
        (terpri)
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
37
        (run* `(pipe (wc ,@uiop-files ,@defsystem-files) (tail -n 1)))))))
38 39 40


;;; debug the source registry that is being used to execute these tools.
41
(deftestcmd list-source-registry ()
42 43
  "Display the source-registry cache"
  (writeln (sort (alexandria:hash-table-alist asdf::*source-registry*)
44
                 'string< :key 'car)))