aboutsummaryrefslogtreecommitdiff
path: root/test/test-lib.el
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-02-12 16:27:35 -0400
committerDavid Bremner <david@tethera.net>2022-02-25 08:38:03 -0400
commitb21fa0e43371b8281b9aa8ea532088800bb37712 (patch)
treea90f190f5fc3974c3b7308e26760f777c8c6f67e /test/test-lib.el
parentc4c6045058456ea0fb057f7690b91077f1b527b8 (diff)
perf-test: allow running test_emacs from performance test suite.
test_require_external prereq has to move to test-lib-common.sh, and the new shell functions print_emacs_header and time_emacs are provided. The somewhat indirect way of printing the output is to avoid the extra "" present on string values from emacsclient.
Diffstat (limited to 'test/test-lib.el')
-rw-r--r--test/test-lib.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test-lib.el b/test/test-lib.el
index 6831b46f..79a9d4d6 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -186,6 +186,11 @@ running, quit if it terminated."
(t (message "%s" err)))
(with-current-buffer "*Messages*" (test-output "MESSAGES"))))
+(defmacro test-time (&rest body)
+ `(let ((results (mapcar (lambda (x) (/ x 5.0)) (benchmark-run 5 ,@body))))
+ (message "\t\t%0.2f\t%0.2f\t%0.2f" (nth 0 results) (nth 1 results) (nth 2 results))
+ (with-current-buffer "*Messages*" (test-output "MESSAGES"))))
+
;; For historical reasons, we hide deleted tags by default in the test
;; suite
(setq notmuch-tag-deleted-formats