From 83a8963310c096620d4390df581b9d01785c2227 Mon Sep 17 00:00:00 2001 From: Jim Wise Date: Mon, 6 Jun 2011 22:27:19 -0400 Subject: [PATCH] Run start-test earlier in with-test. This way, if we bail on a test early because it is disabled, we've still counted the test and recorded the source file. Without this, if the first test in a file was disabled, it would be recorded with the previous source file. --- tests/test-util.lisp | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/tests/test-util.lisp b/tests/test-util.lisp index dbd66a7..7021342 100644 --- a/tests/test-util.lisp +++ b/tests/test-util.lisp @@ -20,25 +20,26 @@ (defmacro with-test ((&key fails-on broken-on skipped-on name) &body body) (let ((block-name (gensym))) - `(cond - ((broken-p ,broken-on) - (fail-test :skipped-broken ',name "Test broken on this platform")) - ((skipped-p ,skipped-on) - (fail-test :skipped-disabled ',name "Test disabled for this combination of platform and features")) - (t - (block ,block-name - (handler-bind ((error (lambda (error) - (if (expected-failure-p ,fails-on) - (fail-test :expected-failure ',name error) - (fail-test :unexpected-failure ',name error)) - (return-from ,block-name)))) - (progn - (log-msg "Running ~S" ',name) - (start-test) - ,@body - (if (expected-failure-p ,fails-on) - (fail-test :unexpected-success ',name nil) - (log-msg "Success ~S" ',name))))))))) + `(progn + (start-test) + (cond + ((broken-p ,broken-on) + (fail-test :skipped-broken ',name "Test broken on this platform")) + ((skipped-p ,skipped-on) + (fail-test :skipped-disabled ',name "Test disabled for this combination of platform and features")) + (t + (block ,block-name + (handler-bind ((error (lambda (error) + (if (expected-failure-p ,fails-on) + (fail-test :expected-failure ',name error) + (fail-test :unexpected-failure ',name error)) + (return-from ,block-name)))) + (progn + (log-msg "Running ~S" ',name) + ,@body + (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 -- 1.7.10.4