source: branches/0.15.x/abcl/test/lisp/ansi/package.lisp

Last change on this file was 11599, checked in by Mark Evenson, 17 years ago

Use HANDLER-CASE for ANSI tests to quit invoking Lisp if an error in generated.

Further incremental work on ABCL-TEST-LISP (aka the internal ABCL
tests) necessitated by the fact that both it and the ANSI tests use
the REGRESSION-TEST framework which doesn't work well in the same Lisp
instances. Trying to repackage this correctly, but it needs more work.

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
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*.
18Possibly 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'.
45Because ~A.
46To resolve, please locally obtain ~A,
47and 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
Note: See TracBrowser for help on using the repository browser.