X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-util.lisp;h=dbd66a789c1e1f4e2b04d44af3eed1bda6131fa2;hb=4c81c652cdc32faefee1bccb84c3c9a7854e3edd;hp=cdc422c83de1b7c34244bd7e4c885e83f7b8e8fb;hpb=0fd1ec424a7e5969a76a2531e42a6b2621e63c11;p=sbcl.git diff --git a/tests/test-util.lisp b/tests/test-util.lisp index cdc422c..dbd66a7 100644 --- a/tests/test-util.lisp +++ b/tests/test-util.lisp @@ -18,21 +18,27 @@ (terpri *trace-output*) (force-output *trace-output*)) -(defmacro with-test ((&key fails-on name) &body body) +(defmacro with-test ((&key fails-on broken-on skipped-on name) &body body) (let ((block-name (gensym))) - `(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))))))) + `(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))))))))) (defun report-test-status () (with-standard-io-syntax @@ -60,6 +66,12 @@ (defun expected-failure-p (fails-on) (sb-impl::featurep fails-on)) +(defun broken-p (broken-on) + (sb-impl::featurep broken-on)) + +(defun skipped-p (skipped-on) + (sb-impl::featurep skipped-on)) + (defun really-invoke-debugger (condition) (with-simple-restart (continue "Continue") (let ((*invoke-debugger-hook* *invoke-debugger-hook*))