Often times, I want to just run a subset of the tests in the
testsuite. Right now, what I do is comment out the tests I don't want
to run in tests/testsuite.lisp.
After a while, though, this gets tiring when I keep changing the tests
I want to run. I suppose I could have an additional file that sets
*testsuite-files* to what I want, but that gets tiresome too.
So, here is a patch allow the user to specify what tests he wants to
run with run_testsuite. It takes a third argument that is a list of
the files that should be run. So if I only want rtest14 and rtesthyp,
I can say:
run_testsuite(false,false,["rtest14.mac", "rtesthyp.mac"]);
and only those tests will be run.
Is there an interest to include this?
Ray
diff -u -r1.25 mload.lisp
--- src/mload.lisp 12 Apr 2005 04:13:18 -0000 1.25
+++ src/mload.lisp 12 Apr 2005 21:05:59 -0000
@@ -960,15 +960,32 @@
(defvar *maxima-testsdir*)
-(defun $run_testsuite (&optional (show-known-bugs nil) (show-all nil))
+(defun intersect-tests (tests)
+ ;; If TESTS is non-NIL, we assume it's a Maxima list of (maxima)
+ ;; strings naming the tests we want to run. They must match the
+ ;; file names in *testsuite-files*. We ignore any items that aren't
+ ;; in *testsuite-files*.
+ (cond (tests
+ (intersection *testsuite-files*
+ (mapcar #'maxima-string (cdr tests))
+ :key #'(lambda (x)
+ (if (listp x)
+ (car x)
+ x))
+ :test #'string=))
+ (t
+ *testsuite-files*)))
+
+(defun $run_testsuite (&optional (show-known-bugs nil) (show-all nil) (tests nil))
(let ((test-file)
(expected-failures))
(setq *collect-errors* nil)
(load (concatenate 'string *maxima-testsdir* "/" "testsuite.lisp"))
(let ((error-break-file)
- (testresult))
+ (testresult)
+ (tests-to-run (intersect-tests tests)))
(time
- (loop with errs = '() for testentry in *testsuite-files*
+ (loop with errs = '() for testentry in tests-to-run
do
(if (atom testentry)
(progn