diff --git a/GNUmakefile b/GNUmakefile index 301839c78e8ecd033e761506422549de5f52ef78..d267c783017f3d10ad0030d73b8bf4558f17cc6e 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -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 diff --git a/asdf.lisp b/asdf.lisp index 6a13da88c0fbadb6c497ab1e60b8d86f503c59b6..a61bed523f73af25f48b8a5f230595f2c9fc10b7 100644 --- a/asdf.lisp +++ b/asdf.lisp @@ -1,6 +1,10 @@ ;;; 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" diff --git a/test/make-webpage.lisp b/test/make-webpage.lisp index f0fe89301098a5313247233b3b12767f802104c4..667c7287f7b0c130822d6066ec83d44b15cb9cc1 100644 --- a/test/make-webpage.lisp +++ b/test/make-webpage.lisp @@ -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 diff --git a/test/run-tests.sh b/test/run-tests.sh index 0b4afe088f7430ef6c7fc64b7256e88c4d68c478..0cc7bb38e887d1717244d6893867aa5052c0b6b2 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -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 diff --git a/website/source/getting-started.mmd b/website/source/getting-started.mmd index b93d0bd53c2eefdd588cf0ae342c98899e1dbe85..ea6522ac95b54ef114d61e3e9def71d372fcf528 100644 --- a/website/source/getting-started.mmd +++ b/website/source/getting-started.mmd @@ -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 diff --git a/website/source/index.mmd b/website/source/index.mmd index 841167fc8c98c0303eaf2609dd14ae63a9192f19..4d764af9e9b1d3e9043a9c8cab394dfba05e8e4a 100644 --- a/website/source/index.mmd +++ b/website/source/index.mmd @@ -5,7 +5,7 @@ * [Mailing Lists][] * [Getting it][] * [Changelog][] - {remark "* [System Tests][tr]"} + * [System Tests][tests] </div> <div class="system-description"> diff --git a/website/source/manual.mmd b/website/source/manual.mmd index 140e3dc0c0b6217d06e45e4271e5747cf53bbd93..c6b4952192e15615734468985edb6ab590a18f89 100644 --- a/website/source/manual.mmd +++ b/website/source/manual.mmd @@ -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 diff --git a/website/source/resources/shared-header.md b/website/source/resources/shared-header.md index 6c6528c10c4894b36ae4d5055935de804215728c..77a2c1cb3a5fdfff9cc0a434947fc413a1c8f12d 100644 --- a/website/source/resources/shared-header.md +++ b/website/source/resources/shared-header.md @@ -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 diff --git a/website/website.tmproj b/website/website.tmproj index 46c2dae57693386fd4161ee454a0abcdee071b33..088b3e1ec48624ec6c930287baea4da26b2fcb21 100644 --- a/website/website.tmproj +++ b/website/website.tmproj @@ -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>