X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-util.lisp;h=cdc422c83de1b7c34244bd7e4c885e83f7b8e8fb;hb=a7e90050c1617168d162b7219c4aeede3e90205a;hp=e49c62763e323321c47aad92ed6b4017ecbf9b5a;hpb=ad0133544b3497c34e656ba2519cee5dfd70e828;p=sbcl.git diff --git a/tests/test-util.lisp b/tests/test-util.lisp index e49c627..cdc422c 100644 --- a/tests/test-util.lisp +++ b/tests/test-util.lisp @@ -12,6 +12,12 @@ (defvar *break-on-failure* nil) (defvar *break-on-expected-failure* nil) +(defun log-msg (&rest args) + (format *trace-output* "~&::: ") + (apply #'format *trace-output* args) + (terpri *trace-output*) + (force-output *trace-output*)) + (defmacro with-test ((&key fails-on name) &body body) (let ((block-name (gensym))) `(block ,block-name @@ -21,10 +27,12 @@ (fail-test :unexpected-failure ',name error)) (return-from ,block-name)))) (progn + (log-msg "Running ~S" ',name) (start-test) ,@body - (when (expected-failure-p ,fails-on) - (fail-test :unexpected-success ',name nil))))))) + (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 @@ -40,6 +48,8 @@ (incf *test-count*)) (defun fail-test (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* @@ -55,3 +65,8 @@ (let ((*invoke-debugger-hook* *invoke-debugger-hook*)) (enable-debugger) (invoke-debugger condition)))) + +(defun test-env () + (cons (format nil "SBCL_MACHINE_TYPE=~A" (machine-type)) + (cons (format nil "SBCL_SOFTWARE_TYPE=~A" (software-type)) + (posix-environ))))