aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Gunbin2019-10-31 21:39:01 +0300
committerFilipp Gunbin2019-11-01 15:20:42 +0300
commit0bffb3e69d4f45b4f4bc553af3ed6e78cfd6bd49 (patch)
tree3b8d9f74915c1202d8523c4da4c0413ee091ff23
parent8758c96dc7f252944eb97b95c92081b157084477 (diff)
downloademacs-0bffb3e69d4f45b4f4bc553af3ed6e78cfd6bd49.tar.gz
emacs-0bffb3e69d4f45b4f4bc553af3ed6e78cfd6bd49.zip
Make ant regexp in compilation-error-regexp-alist-alist more lax
* lisp/progmodes/compile.el: Make ant regexp accept filenames that may occur on Cygwin (like c:/test) and optional additional severity level after task name. * etc/compilation.txt: Add sample.
-rw-r--r--etc/compilation.txt9
-rw-r--r--lisp/progmodes/compile.el7
-rw-r--r--test/lisp/progmodes/compile-tests.el18
3 files changed, 23 insertions, 11 deletions
diff --git a/etc/compilation.txt b/etc/compilation.txt
index 4a4a318d031..7cd33bbd7a0 100644
--- a/etc/compilation.txt
+++ b/etc/compilation.txt
@@ -49,10 +49,11 @@ The regexps found on http://ant.apache.org/faq.html, and since
49integrated in both Emacsen, were hairy. The extra two numbers for 49integrated in both Emacsen, were hairy. The extra two numbers for
50jikes are the ending line and ending column. 50jikes are the ending line and ending column.
51 51
52 [javac] /src/DataBaseTestCase.java:27: unreported exception ... 52 [javac] /src/DataBaseTestCase.java:27: unreported exception ...
53 [javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally 53 [javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally
54 [jikes] foo.java:3:5:7:9: blah blah 54 [jikes] foo.java:3:5:7:9: blah blah
55 [javadoc] c:\MyProject\Polynomial.java:560: error: unknown tag: math 55 [javadoc] c:\MyProject\Polynomial.java:560: error: unknown tag: math
56 [checkstyle] [ERROR] /src/Test.java:38: warning: foo: bar
56 57
57 58
58* Bash v2 59* Bash v2
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index b0bb728de0e..f412dbcd546 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -181,9 +181,12 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
181 (aix 181 (aix
182 " in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1) 182 " in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1)
183 183
184 ;; Checkstyle task may report its own severity level: "[checkstyle] [ERROR] ..."
185 ;; (see AuditEventDefaultFormatter.java in checkstyle sources).
184 (ant 186 (ant
185 "^[ \t]*\\[[^] \n]+\\][ \t]*\\(\\(?:[A-Za-z]:\\\\\\)?[^: \n]+\\):\\([0-9]+\\):\\(?:\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\):\\)?\ 187 "^[ \t]*\\(?:\\[[^] \n]+\\][ \t]*\\)\\{1,2\\}\\(\\(?:[A-Za-z]:\\)?[^: \n]+\\):\
186\\( warning\\)?" 1 (2 . 4) (3 . 5) (6)) 188\\([0-9]+\\):\\(?:\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\):\\)?\\( warning\\)?"
189 1 (2 . 4) (3 . 5) (6))
187 190
188 (bash 191 (bash
189 "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2) 192 "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2)
diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el
index e38c31dd0a4..4c2ce83ddeb 100644
--- a/test/lisp/progmodes/compile-tests.el
+++ b/test/lisp/progmodes/compile-tests.el
@@ -55,11 +55,19 @@
55 25 nil 8 "errors.c") 55 25 nil 8 "errors.c")
56 ;; ant 56 ;; ant
57 ("[javac] /src/DataBaseTestCase.java:27: unreported exception ..." 57 ("[javac] /src/DataBaseTestCase.java:27: unreported exception ..."
58 13 nil 27 "/src/DataBaseTestCase.java") 58 13 nil 27 "/src/DataBaseTestCase.java" 2)
59 ("[javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally" 59 ("[javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally"
60 13 nil 49 "/src/DataBaseTestCase.java") 60 13 nil 49 "/src/DataBaseTestCase.java" 1)
61 ("[jikes] foo.java:3:5:7:9: blah blah" 61 ("[jikes] foo.java:3:5:7:9: blah blah"
62 14 (5 . 10) (3 . 7) "foo.java") 62 14 (5 . 10) (3 . 7) "foo.java" 2)
63 ("[javac] c:/cygwin/Test.java:12: error: foo: bar"
64 9 nil 12 "c:/cygwin/Test.java" 2)
65 ("[javac] c:\\cygwin\\Test.java:87: error: foo: bar"
66 9 nil 87 "c:\\cygwin\\Test.java" 2)
67 ;; Checkstyle error, but ant reports a warning (note additional
68 ;; severity level after task name)
69 ("[checkstyle] [ERROR] /src/Test.java:38: warning: foo"
70 22 nil 38 "/src/Test.java" 1)
63 ;; bash 71 ;; bash
64 ("a.sh: line 1: ls-l: command not found" 72 ("a.sh: line 1: ls-l: command not found"
65 1 nil 1 "a.sh") 73 1 nil 1 "a.sh")
@@ -420,8 +428,8 @@ The test data is in `compile-tests--test-regexps-data'."
420 (compilation-num-warnings-found 0) 428 (compilation-num-warnings-found 0)
421 (compilation-num-infos-found 0)) 429 (compilation-num-infos-found 0))
422 (mapc #'compile--test-error-line compile-tests--test-regexps-data) 430 (mapc #'compile--test-error-line compile-tests--test-regexps-data)
423 (should (eq compilation-num-errors-found 90)) 431 (should (eq compilation-num-errors-found 92))
424 (should (eq compilation-num-warnings-found 35)) 432 (should (eq compilation-num-warnings-found 36))
425 (should (eq compilation-num-infos-found 26))))) 433 (should (eq compilation-num-infos-found 26)))))
426 434
427(ert-deftest compile-test-grep-regexps () 435(ert-deftest compile-test-grep-regexps ()