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 | ;; Do what 'make clean' would do from the GCL ANSI tests, |
---|
36 | ;; so we don't have to hunt for 'make' on win32. |
---|
37 | (mapcar #'delete-file |
---|
38 | (append (directory (format nil "~A/*.cls" *default-pathname-defaults*)) |
---|
39 | (directory (format nil "~A/*.abcl" *default-pathname-defaults*)) |
---|
40 | (directory (format nil "~A/scratch/*" *default-pathname-defaults*)) |
---|
41 | (mapcar (lambda(x) (format nil "~A/~A" *default-pathname-defaults* x)) |
---|
42 | '("scratch/" |
---|
43 | "scratch.txt" "foo.txt" "foo.lsp" |
---|
44 | "foo.dat" |
---|
45 | "tmp.txt" "tmp.dat" "tmp2.dat" |
---|
46 | "temp.dat" "out.class" |
---|
47 | "file-that-was-renamed.txt" |
---|
48 | "compile-file-test-lp.lsp" |
---|
49 | "compile-file-test-lp.out" |
---|
50 | "ldtest.lsp")))) |
---|
51 | (time (load boot-file)) |
---|
52 | (format t "<--- ~A ends.~%" message)) |
---|
53 | (file-error (e) |
---|
54 | (error |
---|
55 | (format nil |
---|
56 | "Failed to find the GCL ANSI tests in '~A'. |
---|
57 | Because ~A. |
---|
58 | To resolve, please locally obtain ~A, |
---|
59 | and set the value of *ANSI-TESTS-DIRECTORY* to that location." |
---|
60 | ansi-tests-directory e |
---|
61 | *ansi-tests-master-source-location*)))))) |
---|
62 | |
---|
63 | |
---|
64 | |
---|
65 | |
---|