aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMattias EngdegÄrd2019-10-04 15:23:13 +0200
committerMattias EngdegÄrd2019-10-04 15:43:15 +0200
commitd09cbcee9ce90171a20a3cae4a27dc08dcb1af41 (patch)
tree555b7397e55cde0275993eae0f0dc71875116433 /test
parent5f06b9c478894c828fc5467b0aae360e2c2d1fd2 (diff)
downloademacs-d09cbcee9ce90171a20a3cae4a27dc08dcb1af41.tar.gz
emacs-d09cbcee9ce90171a20a3cae4a27dc08dcb1af41.zip
Make compile-tests re-runnable
* test/lisp/progmodes/compile-tests.el (compile-test-error-regexps): Don't rely on compilation-num-errors (etc) all being zero, which they aren't if the test has been run before. (compile-tests--test-regexps-data): Change defvar to defconst.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/compile-tests.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el
index 0d4f7f2ff28..3ff4521d2d8 100644
--- a/test/lisp/progmodes/compile-tests.el
+++ b/test/lisp/progmodes/compile-tests.el
@@ -30,7 +30,7 @@
30(require 'ert) 30(require 'ert)
31(require 'compile) 31(require 'compile)
32 32
33(defvar compile-tests--test-regexps-data 33(defconst compile-tests--test-regexps-data
34 ;; The computed column numbers are zero-indexed, so subtract 1 from 34 ;; The computed column numbers are zero-indexed, so subtract 1 from
35 ;; what's reported in the string. The end column numbers are for 35 ;; what's reported in the string. The end column numbers are for
36 ;; the character after, so it matches what's reported in the string. 36 ;; the character after, so it matches what's reported in the string.
@@ -401,10 +401,13 @@ can only work with the NUL byte to disambiguate colons.")
401The test data is in `compile-tests--test-regexps-data'." 401The test data is in `compile-tests--test-regexps-data'."
402 (with-temp-buffer 402 (with-temp-buffer
403 (font-lock-mode -1) 403 (font-lock-mode -1)
404 (mapc #'compile--test-error-line compile-tests--test-regexps-data) 404 (let ((compilation-num-errors-found 0)
405 (should (eq compilation-num-errors-found 87)) 405 (compilation-num-warnings-found 0)
406 (should (eq compilation-num-warnings-found 32)) 406 (compilation-num-infos-found 0))
407 (should (eq compilation-num-infos-found 20)))) 407 (mapc #'compile--test-error-line compile-tests--test-regexps-data)
408 (should (eq compilation-num-errors-found 87))
409 (should (eq compilation-num-warnings-found 32))
410 (should (eq compilation-num-infos-found 20)))))
408 411
409(ert-deftest compile-test-grep-regexps () 412(ert-deftest compile-test-grep-regexps ()
410 "Test the `grep-regexp-alist' regexps. 413 "Test the `grep-regexp-alist' regexps.