1 | (defpackage :abcl.test.ansi |
---|
2 | (:use :cl :asdf) |
---|
3 | (:nicknames "ansi-tests" "abcl-ansi-tests" "gcl-ansi") |
---|
4 | (:export :run)) |
---|
5 | |
---|
6 | (in-package :abcl.test.ansi) |
---|
7 | |
---|
8 | (defparameter *ansi-tests-master-source-location* |
---|
9 | "<svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests>") |
---|
10 | |
---|
11 | (defparameter *ansi-tests-directory* |
---|
12 | (merge-pathnames |
---|
13 | #p"../ansi-tests/" |
---|
14 | (asdf:component-pathname (asdf:find-system :abcl)))) |
---|
15 | |
---|
16 | (defun run (&key (compile-tests nil)) |
---|
17 | "Run the ANSI-TESTS suite, to be found in *ANSI-TESTS-DIRECTORY*. |
---|
18 | Possibly running the compiled version of the tests if COMPILE-TESTS is non-NIL." |
---|
19 | (let* ((ansi-tests-directory |
---|
20 | *ansi-tests-directory*) |
---|
21 | (boot-file |
---|
22 | (if compile-tests "compileit.lsp" "doit.lsp")) |
---|
23 | (message |
---|
24 | (format nil "Invocation of '~A' in ~A" boot-file ansi-tests-directory))) |
---|
25 | (handler-case |
---|
26 | (progv |
---|
27 | '(*default-pathname-defaults*) |
---|
28 | `(,(merge-pathnames *ansi-tests-directory* *default-pathname-defaults*)) |
---|
29 | (format t "---> ~A begins.~%" message) |
---|
30 | (format t "Invoking ABCL hosted on ~A ~A.~%" |
---|
31 | (software-type) (software-version)) |
---|
32 | (if (find :unix *features*) |
---|
33 | (run-shell-command "cd ~A; make clean" ansi-tests-directory) |
---|
34 | ;; XXX -- what to invoke on win32? Untested: |
---|
35 | (run-shell-command |
---|
36 | (format nil "~A~%~A" |
---|
37 | (format nil "cd ~A" *ansi-tests-directory*) |
---|
38 | (format nil "erase *.cls *.abcl")))) |
---|
39 | (time (load boot-file)) |
---|
40 | (format t "<--- ~A ends.~%" message)) |
---|
41 | (file-error (e) |
---|
42 | (error |
---|
43 | (format nil |
---|
44 | "Failed to find the GCL ANSI tests in '~A'. |
---|
45 | Because ~A. |
---|
46 | To resolve, please locally obtain ~A, |
---|
47 | and set the value of *ANSI-TESTS-DIRECTORY* to that location." |
---|
48 | ansi-tests-directory e |
---|
49 | *ansi-tests-master-source-location*)))))) |
---|
50 | |
---|
51 | |
---|
52 | |
---|
53 | |
---|