source: trunk/abcl/test/lisp/ansi/package.lisp @ 12811

Last change on this file since 12811 was 12811, checked in by Mark Evenson, 13 years ago

Re-implement clean for ANSI tests in Lisp to work under Windows.

Thanks to Matt Sedon.

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