Commit aae7de4a authored by Gary King's avatar Gary King

Added test results to website

* new file - test/make-webpage.lisp

* added `test-all` target to run tests on all the lisps the test system knows about

* added test-results.html to website with link from index

* documentation tweaks
parent 92b2ebaa
......@@ -7,6 +7,12 @@ clnet_home := "/project/asdf/public_html/"
sourceDirectory := $(shell pwd)
lisps = allegro allegromodern ccl clisp sbcl
ifndef lisp
lisp := sbcl
endif
# website, tag, install
install: archive-copy
......@@ -39,4 +45,13 @@ clean: FORCE
fi; \
done
test: FORCE
@cd test; ./run-tests.sh $(lisp) $(test-regex)
echo "My foot is $?"
test-all: FORCE
@for lisp in $(lisps); do \
make test lisp=$$lisp; \
done
sbcl --userinit /dev/null --sysinit /dev/null --load test/make-webpage.lisp --eval "(quit)"
FORCE:
\ No newline at end of file
;;; This is asdf: Another System Definition Facility.
;;; hash - $Format:%H$
;;;
;;; Local Variables:
;;; mode: lisp
;;; End:
;;;
;;; Feedback, bug reports, and patches are all welcome: please mail to
;;; <asdf-devel@common-lisp.net>. But note first that the canonical
;;; source for asdf is presently on common-lisp.net at
......@@ -1085,7 +1089,12 @@ it from disk).
The traverse operation is wrapped in `with-compilation-unit` and error
handling code. If a `version` argument is supplied, then operate also
ensures that the system found satisfies it using the `version-satisfies`
method."))
method.
Note that dependencies may cause the operation to invoke other
operations on the system or its components: the new operations will be
created with the same initargs as the original one.
"))
(setf (documentation 'oos 'function)
(format nil
"Short for _operate on system_ and an alias for the [operate][] function. ~&~&~a"
......
......@@ -4,6 +4,38 @@
#+(or)
(build-web-page "/repository/git/asdf/test/results/" "/tmp/x.html" :if-exists :supersede)
(defun extract-summary (pathname stream)
(with-open-file (in pathname :direction :input
:if-does-not-exist :error)
(let ((start nil))
(loop for line = (read-line in nil :eof)
until (eq line :eof) do
(when (and (> (length line) 5) (string-equal "-#---" (subseq line 0 5)))
(setf start t))
(when start
(format stream "~&~a~%" line))))))
(defun html-header (stream title style-sheet)
(format stream "~&<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">")
(format stream "~&<html>~&<head>")
(when title
(format stream "~&<title>~a</title>" title))
(when style-sheet
(unless (search ".css" style-sheet)
(setf style-sheet (concatenate 'string style-sheet ".css")))
(format stream "~&<link type='text/css' href='~a' rel='stylesheet' />"
style-sheet))
(format stream "~&</head>~&<body>"))
(defun html-footer (stream)
(format stream "<div id=\"footer\">")
(format stream "~&generated on ~a"
(format-date "%B %d, %Y" (get-universal-time)))
(format stream "</div>")
(format stream "~&</body></html>"))
(defun build-web-page (input-directory output-file &key (if-exists :error)
(title "ASDF test report") (style-sheet "styles.css"))
(with-open-file (stream output-file
......@@ -24,17 +56,6 @@
(html-footer stream)
))
(defun extract-summary (pathname stream)
(with-open-file (in pathname :direction :input
:if-does-not-exist :error)
(let ((start nil))
(loop for line = (read-line in nil :eof)
until (eq line :eof) do
(when (and (> (length line) 5) (string-equal "-#---" (subseq line 0 5)))
(setf start t))
(when start
(format stream "~&~a~%" line))))))
;;; metatilities-base
;;; because sometimes copy and paste is just too easy
......@@ -64,6 +85,56 @@
(defparameter +days-per-month+
'(31 28 31 30 31 30 31 31 30 31 30 31))
(defun days-in-month (month &optional leap-year?)
"Returns the number of days in the specified month. The month should be
between 1 and 12."
(+ (nth (1- month) +days-per-month+) (if (and (= month 2) leap-year?) 1 0)))
(defun leap-year-p (year)
"Returns t if the specified year is a leap year. I.e. if the year
is divisible by four but not by 100 or if it is divisible by 400."
(or (and (= (mod year 4) 0) ; logand is faster but less perspicuous
(not (= (mod year 100) 0)))
(= (mod year 400) 0)))
(defun day-of-year (date)
"Returns the day of the year [1 to 366] of the specified date [which must be \(CL\) universal time format.]"
(let ((leap-year? (leap-year-p (time-year date))))
(+ (loop for month from 1 to (1- (time-month date)) sum
(days-in-month month leap-year?))
(time-date date))))
(defconstant +longer-format-index+ 0)
(defconstant +shorter-format-index+ 1)
(defparameter +month-output-list+
'(("January" "February" "March" "April" "May" "June" "July" "August" "September"
"October" "November" "December")
("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")))
(defparameter +dow-output-list
'(("Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday")
("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")))
(defun day->string (day-of-the-week &optional (format :long))
"Returns the name of `day-of-the-week`. The parameter should be a number between 0 and 6 where 0 represents Sunday and 6 repressents Saturday. The optional format argument can be either :long or :short. In the latter case, the return string will be of length three; in the former it will be the complete name of the appropriate day."
(check-type day-of-the-week (mod 7))
(check-type format (member :long :short))
(nth day-of-the-week
(case format
(:long (nth +longer-format-index+ +dow-output-list))
(:short (nth +shorter-format-index+ +dow-output-list)))))
(defun month->string (month &optional (format :long))
"Returns the name \(in English\) of the month. Format can be :long or :short."
(check-type month (integer 1 12))
(check-type format (member :long :short))
(nth (1- month)
(case format
(:long (nth +longer-format-index+ +month-output-list+))
(:short (nth +shorter-format-index+ +month-output-list+)))))
(defun format-date (format date &optional stream time-zone)
"Formats universal dates using the same format specifiers as NSDateFormatter. The format is:
......@@ -162,78 +233,8 @@ None of %c, %F, %p, %x, %X, %Z, %z are implemented."
(error "Ouch - unknown formatter '%~c" char))))
(t char)))))))
(defun days-in-month (month &optional leap-year?)
"Returns the number of days in the specified month. The month should be
between 1 and 12."
(+ (nth (1- month) +days-per-month+) (if (and (= month 2) leap-year?) 1 0)))
(defun leap-year-p (year)
"Returns t if the specified year is a leap year. I.e. if the year
is divisible by four but not by 100 or if it is divisible by 400."
(or (and (= (mod year 4) 0) ; logand is faster but less perspicuous
(not (= (mod year 100) 0)))
(= (mod year 400) 0)))
(defun day-of-year (date)
"Returns the day of the year [1 to 366] of the specified date [which must be \(CL\) universal time format.]"
(let ((leap-year? (leap-year-p (time-year date))))
(+ (loop for month from 1 to (1- (time-month date)) sum
(days-in-month month leap-year?))
(time-date date))))
(defconstant +longer-format-index+ 0)
(defconstant +shorter-format-index+ 1)
(defparameter +month-output-list+
'(("January" "February" "March" "April" "May" "June" "July" "August" "September"
"October" "November" "December")
("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")))
(defparameter +dow-output-list
'(("Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday")
("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")))
(defun day->string (day-of-the-week &optional (format :long))
"Returns the name of `day-of-the-week`. The parameter should be a number between 0 and 6 where 0 represents Sunday and 6 repressents Saturday. The optional format argument can be either :long or :short. In the latter case, the return string will be of length three; in the former it will be the complete name of the appropriate day."
(check-type day-of-the-week (mod 7))
(check-type format (member :long :short))
(nth day-of-the-week
(case format
(:long (nth +longer-format-index+ +dow-output-list))
(:short (nth +shorter-format-index+ +dow-output-list)))))
(defun month->string (month &optional (format :long))
"Returns the name \(in English\) of the month. Format can be :long or :short."
(check-type month (integer 1 12))
(check-type format (member :long :short))
(nth (1- month)
(case format
(:long (nth +longer-format-index+ +month-output-list+))
(:short (nth +shorter-format-index+ +month-output-list+)))))
;;; metatilites-base
(defun html-header (stream title style-sheet)
(format stream "~&<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">")
(format stream "~&<html>~&<head>")
(when title
(format stream "~&<title>~a</title>" title))
(when style-sheet
(unless (search ".css" style-sheet)
(setf style-sheet (concatenate 'string style-sheet ".css")))
(format stream "~&<link type='text/css' href='~a' rel='stylesheet' />"
style-sheet))
(format stream "~&</head>~&<body>"))
(defun html-footer (stream)
(format stream "<div id=\"footer\">")
(format stream "~&generated on ~a"
(format-date "%B %d, %Y" (get-universal-time)))
(format stream "</div>")
(format stream "~&</body></html>"))
(let* ((*default-pathname-defaults* (make-pathname :name nil :type nil :defaults *load-truename*))
(source (merge-pathnames
(make-pathname
......
......@@ -48,6 +48,7 @@ if [ $? -eq 0 ] ; then
fi
done
echo >&2
echo "-#---------------------------------------" >&2
echo "Using $1" >&2
echo "Ran $test_count tests: " >&2
echo " $test_pass passing and $test_fail failing" >&2
......@@ -56,6 +57,7 @@ if [ $? -eq 0 ] ; then
else
echo "failing test(s): $failed_list" >&2
fi
echo "-#---------------------------------------" >&2
echo >&2
fi
}
......@@ -71,7 +73,7 @@ fi
if [ "$lisp" = "sbcl" ] ; then
if type sbcl ; then
fasl_ext="fasl"
command="sbcl --userinit /dev/null --sysinit /dev/null --noprogrammer"
command="sbcl --userinit /dev/null --sysinit /dev/null --noinform --noprogrammer"
fi
elif [ "$lisp" = "clisp" ] ; then
if type clisp ; then
......@@ -89,6 +91,11 @@ elif [ "$lisp" = "allegromodern" ] ; then
fasl_ext="fasl"
command="mlisp -q --batch "
fi
elif [ "$lisp" = "ccl" ] ; then
if type ccl ; then
fasl_ext="fasl"
command="ccl --no-init --quiet --batch "
fi
fi
......@@ -99,9 +106,11 @@ fi
if [ -z "$command" ] ; then
echo "Error: don't know how to run Lisp named $lisp"
echo "Error: cannot find or do not know how to run Lisp named $lisp"
else
mkdir -p results
echo $command
do_tests "$command" $fasl_ext
thedate=`date "+%Y-%m-%d"`
do_tests "$command" $fasl_ext 2>&1 | tee "results/${lisp}.text" "results/${lisp}-${thedate}.save"
fi
......@@ -22,8 +22,8 @@ system and for operating on these components in the right
order so that they can be compiled, loaded, tested, etc.
ASDF presents two faces: one for system implementors who need
to be able to describe their systems using ASDF and one for
Lisp programmers and users who want to use those systems.
to be able to describe their systems and one for
Lisp programmers who want to use those systems.
This document describes ASDF for the second audience. If you
want to build your own systems with ASDF, then you'll also
want to read the ASDF [system definition guide][sys-guide].
......@@ -51,7 +51,7 @@ Once you load it in a running Lisp, you're ready to go. For
maximum convenience you will want to have ASDF loaded
whenever you start your Lisp. check your
implementation's manual for details on how to load it from
the startup script or creating a custom Lisp image.-
the startup script or creating a custom Lisp image.
### Using
......@@ -95,7 +95,7 @@ To use ASDF:
* load `asdf.lisp` into your Lisp image,
* make sure ASDF can find system definitions by loading them
yourself or setting up `asdf:*central-registry*`,
yourself or setting up [`asdf:*central-registry*`][*central-registry*],
* use [operate][] to tell ASDF what you'd like to
do to what systems (for simple operations, you can use
......
......@@ -5,7 +5,7 @@
* [Mailing Lists][]
* [Getting it][]
* [Changelog][]
{remark "* [System Tests][tr]"}
* [System Tests][tests]
</div>
<div class="system-description">
......
......@@ -15,11 +15,11 @@ system and for operating on these components in the right
order so that they can be compiled, loaded, tested, etc.
ASDF presents two faces: one for system implementors who need
to be able to describe their systems using ASDF and one for
Lisp programmers and users who want to use those systems. See
to be able to describe their systems and one for
Lisp programmers who want to use those systems. See
the [getting started][getting-started] guide to learn how to
use ASDF to load a system. This document describes how to
write your own system definitions with ASDF.
write your own system definitions for ASDF.
## Defining systems with defsystem
......@@ -30,12 +30,17 @@ develop software. First, some definitions:
components. They range from individual files, to groups of
files called modules, to entire sub-systems.
* system - a group of files and sub-systems (components)
packaged into a coherent whole.
* module - a component comprised of a group of components. A
module is smaller than a system but (usually) larger
than a single file.
* operation - something done to a system. The most typical
operations are *compile*, *load*, and *test* but ASDF is
extensible so many others are possible.
operations are [*compile*][compile-system],
[*load*][load-system], and [*test*][test-system] but ASDF
is extensible so many others are possible.
* system - a group of files, modules and sub-systems
(i.e., components) packaged into a coherent whole.
### The `defsystem` form
......@@ -44,10 +49,11 @@ Systems are defined with the `defsystem` macro{footnote
components using make-instance. Most of the time, however, it
is much more practical to use `defsystem`."} This section
begins with a simple example, then gives the full grammar of
`defsystem`. Here is a complete system definition that file
that should be saved as hello-lisp.asd{footnote "Though it
can be extended, ASDF's standard system finding algorithms
looks for a system named `foo` in a file named `foo.asd`."}:
`defsystem`. Here is a complete system definition that should
be saved in the file `hello-lisp.asd`{footnote
"Though it can be changed, ASDF's standard system finding
algorithms looks for a system named `foo` in a file named
`foo.asd`."}:
(defpackage hello-lisp-system (:use :common-lisp :asdf))
......@@ -78,12 +84,13 @@ Some notes about this example:
that contains three source files: packages, macros and
hello.
* The `:depends-on` clauses tell ASDF that the file macros
depends on packages (presumably because the package it's
in is defined in packages), and the file hello depends on
macros (and hence, transitively on packages). This means
that ASDF will compile and load packages and macros
before starting the compilation of the file hello.
* The `:depends-on` clauses tell ASDF that the file
`macros` depends on `packages` (presumably because the
package it's in is defined in `packages`), and the file
`hello` depends on `macros` (and hence transitively on
`packages`). This means that ASDF will compile and load
`packages` and `macros` before starting the compilation
of the file `hello`.
* The files are located in the same directory as the file
with the system definition. ASDF resolves symbolic links
......@@ -241,14 +248,15 @@ so that users can control certain details of execution of the
Lisp in .asd files:
* Any informative output (other than warnings and errors,
which are the condition system's to dispose of) should be
sent to the standard CL stream `*standard-output*`, so
that users can easily control the disposition of output
from ASDF operations.
which will be handled by the condition system) should be
sent to the Common Lisp stream
[`*standard-output*`][hs-standard-output], so that users
can easily control the disposition of output from ASDF
operations.
## The object model of ASDF
ASDF is object-oriented from the ground up. Both a system's
ASDF is entirely object-oriented. Both a system's
structure and the operations that can be performed on systems
follow a protocol. ASDF is extensible to new operations and
to new component types. This allows the addition of
......@@ -264,13 +272,13 @@ on a system.
### Operations
An operation object of the appropriate type is instantiated
whenever the user wants to do something with a system like
whenever the user wants to do something with a system like:
* compile all its files
* compile all its files,
* load the files into a running lisp environment
* load the files into a running lisp environment,
* copy its source files somewhere else
* copy its source files somewhere else.
Operations can be invoked directly, or examined to see what
their effects would be without performing them. _FIXME:
......@@ -282,14 +290,12 @@ this purpose (perhaps a list of visited nodes, for example)
but primarily is a nice thing to specialise operation methods
on and easier than having them all be EQL methods.
Operations are invoked on systems via `operate`.
Operations are invoked on systems via `operate` or its
synonym `oos`:
{docs operate}
{docs oos}
`operate` invokes an operation on a system. `oos` is a
synonym for `operate`.
#### Predefined operations of ASDF
......@@ -454,7 +460,7 @@ implementations
This optional attribute is used by the test-system-version
operation. See [Predefined operations of ASDF][10]. For the
default method of test-system-version, the version should be
a string of intergers separated by dots, for example
a string of integers separated by dots, for example
'1.0.11'.
##### Required features
......@@ -585,13 +591,11 @@ information to satisfy these systems. Sometimes the creator
of an ASDF system may know the additional information and
wish to provide it directly.
(component-property component property-name) and associated
`(component-property component property-name)` and associated
setf method will allow the programmatic update of this
information. Property names are compared as if by `EQL`, so
use symbols or keywords or something.
symbols or keywords are usually used for property names.
* [Pre-defined subclasses of component][14]
* [Creating new component types][15]
#### Pre-defined subclasses of component
......@@ -942,7 +946,7 @@ Available in updated for Common Lisp form [on the web][kmp-large].
In our implementation we borrow kmp's overall PROCESS-OPTIONS
and concept to deal with creating component trees from
defsystem surface syntax. [ this is not true right now,
though it used to be and probably will be again soon ]
though it used to be and probably will be again soon ].
{remark ## Concept Index
......
......@@ -14,7 +14,8 @@
[sys-guide]: manual.html
[getting-started]: getting-started.html
[FAQ]: faq.html
[tests]: test-results.html
[asdf-devel]: http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
[asdf-announce]: http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-announce
......@@ -24,4 +25,5 @@
[kmp-large]: http://www.nhplace.com/kent/Papers/Large-Systems.html
[hs-require]:
\ No newline at end of file
[hs-require]: http://www.lispworks.com/documentation/HyperSpec/Body/f_provid.htm#require
[hs-standard-output]: http://www.lispworks.com/documentation/HyperSpec/Body/v_debug_.htm#STstandard-outputST
\ No newline at end of file
......@@ -10,19 +10,19 @@
<key>filename</key>
<string>source/getting-started.mmd</string>
<key>lastUsed</key>
<date>2009-06-06T19:08:15Z</date>
<date>2009-06-16T03:15:03Z</date>
</dict>
<dict>
<key>filename</key>
<string>source/index.mmd</string>
<key>lastUsed</key>
<date>2009-06-09T04:08:03Z</date>
<date>2009-06-10T03:11:04Z</date>
</dict>
<dict>
<key>filename</key>
<string>source/manual.mmd</string>
<key>lastUsed</key>
<date>2009-06-09T04:08:03Z</date>
<date>2009-06-16T03:23:40Z</date>
<key>selected</key>
<true/>
</dict>
......@@ -52,7 +52,7 @@
<key>filename</key>
<string>source/style.css</string>
<key>lastUsed</key>
<date>2009-06-09T03:40:11Z</date>
<date>2009-06-10T00:54:20Z</date>
</dict>
<dict>
<key>filename</key>
......@@ -126,28 +126,12 @@
<key>column</key>
<integer>0</integer>
<key>line</key>
<integer>29</integer>
<integer>109</integer>
</dict>
<key>columnSelection</key>
<false/>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
<integer>0</integer>
<key>selectFrom</key>
<dict>
<key>column</key>
<integer>0</integer>
<key>line</key>
<integer>18</integer>
</dict>
<key>selectTo</key>
<dict>
<key>column</key>
<integer>0</integer>
<key>line</key>
<integer>29</integer>
</dict>
<integer>81</integer>
</dict>
<key>source/glossary.md</key>
<dict>
......@@ -168,44 +152,28 @@
<key>caret</key>
<dict>
<key>column</key>
<integer>0</integer>
<integer>21</integer>
<key>line</key>
<integer>43</integer>
<integer>4</integer>
</dict>
<key>columnSelection</key>
<false/>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
<integer>28</integer>
<key>selectFrom</key>
<dict>
<key>column</key>
<integer>0</integer>
<key>line</key>
<integer>33</integer>
</dict>
<key>selectTo</key>
<dict>
<key>column</key>
<integer>0</integer>
<key>line</key>
<integer>43</integer>
</dict>
<integer>39</integer>
</dict>
<key>source/manual.mmd</key>
<dict>
<key>caret</key>
<dict>
<key>column</key>
<integer>0</integer>
<integer>55</integer>
<key>line</key>
<integer>751</integer>
<integer>948</integer>
</dict>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
<integer>723</integer>
<integer>978</integer>
</dict>
<key>source/resources/footer.md</key>
<dict>
......@@ -254,9 +222,9 @@
<key>caret</key>
<dict>
<key>column</key>
<integer>67</integer>
<integer>109</integer>
<key>line</key>
<integer>24</integer>
<integer>27</integer>
</dict>
<key>firstVisibleColumn</key>
<integer>0</integer>
......@@ -296,9 +264,9 @@
<key>caret</key>
<dict>
<key>column</key>
<integer>14</integer>
<integer>0</integer>
<key>line</key>
<integer>3</integer>
<integer>0</integer>
</dict>
<key>firstVisibleColumn</key>
<integer>0</integer>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment