| 1 | (defpackage #:abcl.test.lisp |
|---|
| 2 | (:use #:cl #:abcl-rt) |
|---|
| 3 | (:nicknames "ABCL-TEST-LISP" "ABCL-TEST") |
|---|
| 4 | (:export |
|---|
| 5 | #:run |
|---|
| 6 | #:do-test |
|---|
| 7 | #:do-tests |
|---|
| 8 | #:do-tests-matching |
|---|
| 9 | ;; previously in file-system-tests.lisp |
|---|
| 10 | #:pathnames-equal-p #:run-shell-command #:copy-file #:make-symbolic-link |
|---|
| 11 | #:touch #:make-temporary-directory #:delete-directory-and-files |
|---|
| 12 | ;;; Deprecated |
|---|
| 13 | #:do-matching #:run-matching |
|---|
| 14 | )) |
|---|
| 15 | (in-package #:abcl.test.lisp) |
|---|
| 16 | |
|---|
| 17 | (defparameter *abcl-test-directory* |
|---|
| 18 | (if (find :asdf2 *features*) |
|---|
| 19 | (asdf:system-relative-pathname :abcl-test-lisp "test/lisp/abcl/") |
|---|
| 20 | (make-pathname :host (pathname-host *load-truename*) |
|---|
| 21 | :device (pathname-device *load-truename*) |
|---|
| 22 | :directory (pathname-directory *load-truename*)))) |
|---|
| 23 | |
|---|
| 24 | (defun run () |
|---|
| 25 | "Run the Lisp test suite for ABCL." |
|---|
| 26 | (let ((*default-pathname-defaults* *abcl-test-directory*)) |
|---|
| 27 | (do-tests))) |
|---|
| 28 | |
|---|
| 29 | ;;; XXX move this into test-utilities.lisp? |
|---|
| 30 | (defvar *last-run-matching* "url-pathname") |
|---|
| 31 | |
|---|
| 32 | (defun do-tests-matching (&optional (match *last-run-matching*)) |
|---|
| 33 | "Run all tests in suite whose symbol contains MATCH in a case-insensitive manner." |
|---|
| 34 | (setf *last-run-matching* match) |
|---|
| 35 | (let* ((matching (string-upcase match)) |
|---|
| 36 | (count 0)) |
|---|
| 37 | (mapcar (lambda (entry) |
|---|
| 38 | (if (search matching (symbol-name (abcl-rt::name entry))) |
|---|
| 39 | (setf (abcl-rt::pend entry) t |
|---|
| 40 | count (1+ count)) |
|---|
| 41 | (setf (abcl-rt::pend entry) nil))) |
|---|
| 42 | (rest abcl-rt::*entries*)) |
|---|
| 43 | (format t "Performing ~A tests matching '~A'.~%" count matching) |
|---|
| 44 | (abcl-rt::do-entries t))) |
|---|
| 45 | |
|---|
| 46 | ;;; Deprecated |
|---|
| 47 | (setf (symbol-function 'run-matching) #'do-tests-matching) |
|---|
| 48 | (setf (symbol-function 'do-matching) #'do-tests-matching) |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|