X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-util.lisp;h=92a4b32090e40e9681bf02562bd90ba4b92ea790;hb=ee5629ee974ee8ce7a1cb245a99e94f8943ffd90;hp=702134261dfe5544e5487b766301479af8d25518;hpb=83a8963310c096620d4390df581b9d01785c2227;p=sbcl.git diff --git a/tests/test-util.lisp b/tests/test-util.lisp index 7021342..92a4b32 100644 --- a/tests/test-util.lisp +++ b/tests/test-util.lisp @@ -23,23 +23,23 @@ `(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)))))))))) + ((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 @@ -55,14 +55,18 @@ (incf *test-count*)) (defun fail-test (type test-name condition) - (log-msg "~@<~A ~S ~:_due to ~S: ~4I~:_\"~A\"~:>" - type test-name condition condition) + (if (stringp condition) + (log-msg "~@<~A ~S ~:_~A~:>" + type test-name condition) + (log-msg "~@<~A ~S ~:_due to ~S: ~4I~:_\"~A\"~:>" + type test-name condition condition)) (push (list type *test-file* (or test-name *test-count*)) *failures*) - (when (or (and *break-on-failure* - (not (eq type :expected-failure))) - *break-on-expected-failure*) - (really-invoke-debugger condition))) + (unless (stringp condition) + (when (or (and *break-on-failure* + (not (eq type :expected-failure))) + *break-on-expected-failure*) + (really-invoke-debugger condition)))) (defun expected-failure-p (fails-on) (sb-impl::featurep fails-on))