1.0.25.20: test util: print names, status
authorGabor Melis <mega@hotpop.com>
Mon, 16 Feb 2009 21:32:58 +0000 (21:32 +0000)
committerGabor Melis <mega@hotpop.com>
Mon, 16 Feb 2009 21:32:58 +0000 (21:32 +0000)
tests/test-util.lisp
version.lisp-expr

index e49c627..7ef6b6b 100644 (file)
 (defvar *break-on-failure* nil)
 (defvar *break-on-expected-failure* nil)
 
+(defun log-msg (&rest args)
+  (format *trace-output* "~&::: ")
+  (apply #'format *trace-output* args)
+  (terpri *trace-output*)
+  (force-output *trace-output*))
+
 (defmacro with-test ((&key fails-on name) &body body)
   (let ((block-name (gensym)))
     `(block ,block-name
                                    (fail-test :unexpected-failure ',name error))
                                (return-from ,block-name))))
          (progn
+           (log-msg "Running ~S" ',name)
            (start-test)
            ,@body
-           (when (expected-failure-p ,fails-on)
-             (fail-test :unexpected-success ',name nil)))))))
+           (if (expected-failure-p ,fails-on)
+               (fail-test :unexpected-success ',name nil)
+               (log-msg "Success ~S" ',name)))))))
 
 (defun report-test-status ()
   (with-standard-io-syntax
@@ -40,6 +48,7 @@
   (incf *test-count*))
 
 (defun fail-test (type test-name condition)
+  (log-msg "~A ~S" type test-name)
   (push (list type *test-file* (or test-name *test-count*))
         *failures*)
   (when (or (and *break-on-failure*
index 763f1f2..40dbfee 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.25.19"
+"1.0.25.20"