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