From 260975e8aff635b6b99db835ee8d40ec33ee916c Mon Sep 17 00:00:00 2001 From: David Edmondson Date: Tue, 24 Jan 2012 16:14:05 +0000 Subject: test: Add `test_emacs_expect_t'. Add a new test function to allow simpler testing of emacs functionality. `test_emacs_expect_t' takes one argument - a lisp expression to evaluate. The test passes if the expression returns `t', otherwise it fails and the output is reported to the tester. --- test/test-lib.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/test-lib.el') diff --git a/test/test-lib.el b/test/test-lib.el index 59c58681..96752f0b 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -83,3 +83,12 @@ nothing." (add-hook-counter 'notmuch-hello-mode-hook) (add-hook-counter 'notmuch-hello-refresh-hook) + +(defmacro notmuch-test-run (&rest body) + "Evaluate a BODY of test expressions and output the result." + `(with-temp-buffer + (let ((result (progn ,@body))) + (insert (if (stringp result) + result + (prin1-to-string result))) + (test-output)))) -- cgit v1.2.3