# HG changeset patch # User Aidan Kehoe # Date 1197405714 -3600 # Node ID 94509abd0ef06178d898dd2af041c96eb3c5436e # Parent f70e56bb52a72781ed9382fda2826a6e1ad40f7d Commit a forgotten chunk of 4d0f773d5e21. This is the change to the file tests/automated/test-harness.el. See the tests/ChangeLog of that commit, http://mid.gmane.org/E1J1MtP-0000bo-Vw@alioth.debian.org for the details. diff -r f70e56bb52a7 -r 94509abd0ef0 tests/automated/test-harness.el --- a/tests/automated/test-harness.el Mon Dec 10 01:13:36 2007 -0800 +++ b/tests/automated/test-harness.el Tue Dec 11 21:41:54 2007 +0100 @@ -203,7 +203,29 @@ `(let ((test-harness-failure-tag "KNOWN BUG") (test-harness-success-tag "PASS (FAILURE EXPECTED)")) ,@body)) - + + (defmacro Known-Bug-Expect-Error (expected-error &rest body) + (let ((quoted-body (if (= 1 (length body)) + `(quote ,(car body)) `(quote (progn ,@body))))) + `(let ((test-harness-failure-tag "KNOWN BUG") + (test-harness-success-tag "PASS (FAILURE EXPECTED)")) + (condition-case error-info + (progn + (setq trick-optimizer (progn ,@body)) + (Print-Pass + "%S executed successfully, but expected error %S" + ,quoted-body + ',expected-error) + (incf passes)) + (,expected-error + (Print-Failure "%S ==> error %S, as expected" + ,quoted-body ',expected-error) + (incf no-error-failures)) + (error + (Print-Failure "%S ==> expected error %S, got error %S instead" + ,quoted-body ',expected-error error-info) + (incf wrong-error-failures)))))) + (defmacro Implementation-Incomplete-Expect-Failure (&rest body) `(let ((test-harness-failure-tag "IMPLEMENTATION INCOMPLETE") (test-harness-success-tag "PASS (FAILURE EXPECTED)")) @@ -337,7 +359,9 @@ ;; #### Perhaps this should override `message' itself, too? (defmacro Silence-Message (&rest body) - `(flet ((append-message (&rest args) ())) ,@body)) + `(flet ((append-message (&rest args) ()) + (clear-message (&rest args) ())) + ,@body)) (defmacro Ignore-Ebola (&rest body) `(let ((debug-issue-ebola-notices -42)) ,@body))