r5485: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 10 Aug 2003 07:39:33 +0000 (07:39 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 10 Aug 2003 07:39:33 +0000 (07:39 +0000)
assert.lisp
package.lisp
printer.lisp
result.lisp
tests.lisp
textui.lisp
xlunit.asd

index f9ddec259ad0e6fe5c6d18d95510dc35dc9528cb..e2d7356d537653937a544727bf1c4885ad2b8018 100644 (file)
@@ -2,7 +2,7 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; ID:       $Id: assert.lisp,v 1.9 2003/08/08 00:57:20 kevin Exp $
+;;;; ID:       $Id: assert.lisp,v 1.10 2003/08/10 07:39:33 kevin Exp $
 ;;;; Purpose:  Assert functions for XLUnit
 ;;;;
 ;;;; *************************************************************************
@@ -34,7 +34,7 @@
 
 (defun assert-eql (v1 v2 &optional message)
   (unless (eql v1 v2)
-    (failure-message message "Assert eql: ~S ~S" v1 v2)))
+    (failure-message message "Assert equal: ~S ~S" v1 v2)))
 
 (defun assert-not-eql (v1 v2 &optional message)
   (when (eql v1 v2)
   `(when ,v
      (failure-message ,message "Assert false: ~S" ',v)))
 
-(defmacro assert-condition (condition forms &optional message)
+(defmacro assert-condition (condition form &optional message)
   (let ((cond (gensym "COND-")))
     `(handler-case
         (progn
-          ,forms
+          ,form
           (values))
        (t (,cond)
         (when (and (typep ,cond 'serious-condition)
                          "Assert condition ~A, but no condition signaled"
                          ,condition)))))
 
-(defmacro assert-not-condition (condition forms &optional message)
+(defmacro assert-not-condition (condition form &optional message)
   (let ((cond (gensym "COND-")))
     `(handler-case
         (progn
-          ,forms
+          ,form
           (values))
        (serious-condition (,cond)
         (unless (typep ,cond ,condition)
index 2bdfee579cdca8af427c6d83c6ad62a92b19b043..dce765773d3c2eaafb3ecece0199d2e662291403 100644 (file)
@@ -2,10 +2,10 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; ID:      $Id: package.lisp,v 1.11 2003/08/08 00:57:20 kevin Exp $
+;;;; ID:      $Id: package.lisp,v 1.12 2003/08/10 07:39:33 kevin Exp $
 ;;;; Purpose: Package definition for XLUnit
 ;;;;
-;;;; $Id: package.lisp,v 1.11 2003/08/08 00:57:20 kevin Exp $
+;;;; $Id: package.lisp,v 1.12 2003/08/10 07:39:33 kevin Exp $
 ;;;; *************************************************************************
 
 (in-package #:cl-user)
 
    ;; assert
    #:assert-equal
+   #:assert-eql
+   #:assert-not-eql
    #:assert-true
    #:assert-false
+   #:assert-condition
    #:test
    #:test-error
    #:test-no-error
@@ -44,6 +47,7 @@
    #:remove-test
    #:tests
    #:get-suite
+   #:suite
    #:test-suite
    #:run-on-test-results
    
index ad351c8e7012efa88fef24a670b541c9bedc6acc..8cfeab9f7c3c8aba3a6a28d5fe298b0f9bb9cbdf 100644 (file)
@@ -2,7 +2,7 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; ID:      $Id: printer.lisp,v 1.6 2003/08/05 22:56:25 kevin Exp $
+;;;; ID:      $Id: printer.lisp,v 1.7 2003/08/10 07:39:33 kevin Exp $
 ;;;; Purpose: Printer functions for XLUnit
 ;;;;
 ;;;; *************************************************************************
     (let ((count (length defects)))
       (if (= 1 count)
          (format (ostream obj) "~%There was 1 ~A:~%" title)
-        (format (ostream obj) "~%There were ~D A:~%"
+        (format (ostream obj) "~%There were ~D ~A:~%"
                count title))
       (dotimes (i count)
        (let* ((defect (nth i defects))
               (condition (thrown-condition defect)))
          (format (ostream obj) "~A) ~A: "
                  (1+ i) (name (failed-test defect)))
-         (apply #'format (ostream obj) 
-                (simple-condition-format-control condition)
-                (simple-condition-format-arguments condition))
-         (format (ostream obj) "~%")
-         (when (message condition)
-           (let ((spaces (+ 2 (length (format nil "~D" count)))))
-             (dotimes (i spaces)
-               (write-char #\space (ostream obj))))
-           (format (ostream obj) "~A~%" (message condition))))))))
+         (typecase condition
+           (assertion-failed
+            (apply #'format (ostream obj) 
+                   (simple-condition-format-control condition)
+                   (simple-condition-format-arguments condition))
+            (format (ostream obj) "~%")
+            (when (message condition)
+              (let ((spaces (+ 2 (length (format nil "~D" count)))))
+                (dotimes (i spaces)
+                  (write-char #\space (ostream obj))))
+              (format (ostream obj) "~A~%" (message condition))))
+           (t
+            (format (ostream obj) "~A~%" condition))))))))
 
 
 (defmethod print-footer ((obj textui-test-runner) result)
index 28baaa5644a8f22fe1d85cffab02ec64a9473929..66f69ee9d5091a64c932911c40e259936116466c 100644 (file)
@@ -2,7 +2,7 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; ID:      $Id: result.lisp,v 1.7 2003/08/05 22:56:25 kevin Exp $
+;;;; ID:      $Id: result.lisp,v 1.8 2003/08/10 07:39:33 kevin Exp $
 ;;;; Purpose:  Result functions for XLUnit
 ;;;;
 ;;;; *************************************************************************
@@ -31,7 +31,9 @@
 
 (defmethod start-test ((tcase test) (res test-results))
   (incf (run-tests res))
-  (mapc (lambda (listener) (start-test listener tcase)) (listeners res))
+  (mapc (lambda (listener)
+         (start-test listener tcase)) 
+       (listeners res))
   res)
 
 (defmethod end-test ((tcase test) (res test-results))
index 8042fe850aaeba375da5c44e609b889498aea7cc..540b2bb5b4dc72c2e4cf4c83bdb3691a4d1c254e 100644 (file)
@@ -2,7 +2,7 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Id:      $Id: tests.lisp,v 1.14 2003/08/08 00:57:20 kevin Exp $
+;;;; Id:      $Id: tests.lisp,v 1.15 2003/08/10 07:39:33 kevin Exp $
 ;;;; Purpose: Self Test suite for XLUnit
 ;;;;
 ;;;; *************************************************************************
@@ -49,6 +49,7 @@
 (def-test-method test-condition-without-cond ((self was-run) :run nil)
   (assert-condition 'error (list 'no-error)))
 
+#+ignore
 (def-test-method test-not-condition-with-cond ((self was-run) :run nil)
   (assert-not-condition 'test-condition 
                        (signal 'test-condition)))
 (def-test-method test-condition ((self test-case-test) :run nil)
   (assert-condition 
    'test-condition 
-   (error (make-instance 'test-condition))))
+   (error 'test-condition)))
 
 (def-test-method test-condition-without-cond ((self test-case-test) 
                                              :run nil)
                (summary (run
                          (named-test 'test-condition-without-cond
                                      (get-suite was-run))))))
-  
+
+#+ignore
 (def-test-method test-not-condition ((self test-case-test) :run nil)
   (assert-not-condition 
    'test-condition 
    (progn)))
 
+#+ignore
 (def-test-method test-not-condition-with-cond ((self test-case-test) 
                                              :run nil)
   (assert-equal "1 run, 0 erred, 1 failed"
index ec617e00f5a6ca426a5bbcd139e115d9b85b1909..6486c62229b5aaf71697fef601ef91c66fdcb68f 100644 (file)
@@ -2,7 +2,7 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; ID:      $Id: textui.lisp,v 1.2 2003/08/04 17:04:50 kevin Exp $
+;;;; ID:      $Id: textui.lisp,v 1.3 2003/08/10 07:39:33 kevin Exp $
 ;;;; Purpose: Text UI for Test Runner
 ;;;;
 ;;;; *************************************************************************
@@ -36,5 +36,5 @@
     (run-on-test-results ob result)
     (print-results test-runner result 
                   (/ (- (get-internal-real-time) start-time)
-                    internal-time-units-per-second))))
-                                                                                 
+                     internal-time-units-per-second))
+    result))
index 1e9d6c2e9ca9b9ce87a30d61c231c572ae333671..76fbc372c1277713e90a2a5c3cff5e519a86fb7d 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Aug 2003
 ;;;;
-;;;; $Id: xlunit.asd,v 1.8 2003/08/08 00:57:20 kevin Exp $
+;;;; $Id: xlunit.asd,v 1.9 2003/08/10 07:39:33 kevin Exp $
 ;;;; *************************************************************************
 
 (defpackage #:xlunit-system (:use #:asdf #:cl))
@@ -41,7 +41,7 @@
    ))
 
 (defmethod perform ((o test-op) (c (eql (find-system 'xlunit))))
-  (operate 'load-op 'xlunit-tests :force t)
+  (operate 'load-op 'xlunit-tests)
   (operate 'test-op 'xlunit-tests :force t))
 
 (defsystem xlunit-tests