From: Glenn Morris Date: Tue, 25 Jun 2013 02:24:32 +0000 (-0700) Subject: * test/automated/occur-tests.el (occur-test-create): New function. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1992^2~50 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=51f853872f483e5726dda134a25c3c73bc712c2c;p=emacs.git * 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. --- 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)