From 51f853872f483e5726dda134a25c3c73bc712c2c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 24 Jun 2013 19:24:32 -0700 Subject: [PATCH] * test/automated/occur-tests.el (occur-test-create): New function. Use it to create separate tests for each element, so we run them all rather than stopping at the first error. --- test/ChangeLog | 6 ++++++ test/automated/occur-tests.el | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index 607be5c5244..4cacbf2766b 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2013-06-25 Glenn Morris + + * automated/occur-tests.el (occur-test-create): New function. + Use it to create separate tests for each element, so we run them + all rather than stopping at the first error. + 2013-06-24 Glenn Morris * automated/occur-tests.el (occur-tests): diff --git a/test/automated/occur-tests.el b/test/automated/occur-tests.el index c690f4ada20..306803b7567 100644 --- a/test/automated/occur-tests.el +++ b/test/automated/occur-tests.el @@ -335,12 +335,18 @@ Each element has the format: (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) -(ert-deftest occur-tests () - "Test the functionality of `occur'. -The test data is in the `occur-tests' constant." - (let ((occur-hook nil)) - (dolist (test occur-tests) - (should (occur-test-case test))))) +(defun occur-test-create (n) + "Create a test for element N of the `occur-tests' constant." + (let ((testname (intern (format "occur-test-%.2d" n))) + (testdoc (format "Test element %d of `occur-tests'." n))) + (eval + `(ert-deftest ,testname () + ,testdoc + (let (occur-hook) + (should (occur-test-case (nth ,n occur-tests)))))))) + +(dotimes (i (length occur-tests)) + (occur-test-create i)) (provide 'occur-tests) -- 2.11.4.GIT