X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests.lisp;h=8fcd86281c1284edb0c89f51d4b1019b6cd382ca;hb=cbfef25a94fd3082f517d93bc40d9e9e61e1da11;hp=b230068c023f96093ab1aab012bbd0b0b6b1da81;hpb=ad091133b3c6e27c105f6631076cb408df386d42;p=jscl.git diff --git a/tests.lisp b/tests.lisp index b230068..8fcd862 100644 --- a/tests.lisp +++ b/tests.lisp @@ -1,15 +1,35 @@ -(defvar *passed-tets* 0) -(defvar *failed-tets* 0) -(defvar *timestamp* (get-internal-real-time)) +(defvar *total-tests* 0) +(defvar *passed-tests* 0) +(defvar *failed-tests* 0) + +(defvar *expected-failures* 0) +(defvar *unexpected-passes* 0) + +(defvar *timestamp* nil) (defmacro test (condition) - `(cond - (,condition - (write-line ,(concat "Test `" (prin1-to-string condition) "' passed")) - (incf *passed-tets*)) - (t - (write-line ,(concat "Test `" (prin1-to-string condition) "' failed.")) - (incf *failed-tets*)))) + `(progn + (cond + (,condition + (write-line ,(concat "Test `" (prin1-to-string condition) "' passed")) + (incf *passed-tests*)) + (t + (write-line ,(concat "Test `" (prin1-to-string condition) "' failed.")) + (incf *failed-tests*))) + (incf *total-tests*))) + +(defmacro expected-failure (condition) + `(progn + (cond + (,condition + (write-line ,(concat "Test `" (prin1-to-string condition) "' passed unexpectedly!")) + (incf *unexpected-passes*)) + (t + (write-line ,(concat "Test `" (prin1-to-string condition) "' failed expectedly.")) + (incf *expected-failures*))) + (incf *total-tests*))) (write-line "Running tests...") (write-line "") + +(setq *timestamp* (get-internal-real-time))