2016-12-10 21:36:15 +01:00
;;; compile-tests.el --- Test suite for compile.el. -*- lexical-binding: t; -*-
2011-05-08 21:22:05 -04:00
2021-01-01 01:13:56 -08:00
;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
2011-05-08 21:22:05 -04:00
;; Author: Chong Yidong <cyd@stupidchicken.com>
;; Keywords: internal
;; Human-Keywords: internal
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
2017-09-13 15:52:52 -07:00
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
2011-05-08 21:22:05 -04:00
2016-12-10 21:36:15 +01:00
;;; Commentary:
;; Unit tests for lisp/progmodes/compile.el.
2011-05-08 21:22:05 -04:00
;;; Code:
( require 'ert )
( require 'compile )
2019-10-04 15:23:13 +02:00
( defconst compile-tests--test-regexps-data
2011-05-08 21:22:05 -04:00
;; The computed column numbers are zero-indexed, so subtract 1 from
;; what's reported in the string. The end column numbers are for
;; the character after, so it matches what's reported in the string.
' ( ;; absoft
2020-10-19 12:14:37 +02:00
( absoft
" Error on line 3 of t.f: Execution error unclassifiable statement "
2011-05-08 21:22:05 -04:00
1 nil 3 " t.f " )
2020-10-19 12:14:37 +02:00
( absoft " Line 45 of \" foo.c \" : bloofle undefined "
2011-05-08 21:22:05 -04:00
1 nil 45 " foo.c " )
2020-10-19 12:14:37 +02:00
( absoft " error on line 19 of fplot.f: spelling error? "
2011-05-08 21:22:05 -04:00
1 nil 19 " fplot.f " )
2020-10-19 12:14:37 +02:00
( absoft
" warning on line 17 of fplot.f: data type is undefined for variable d "
2011-05-08 21:22:05 -04:00
1 nil 17 " fplot.f " )
;; Ada & Mpatrol
2020-10-19 12:14:37 +02:00
( gnu " foo.adb:61:11: [...] in call to size declared at foo.ads:11 "
2011-12-03 11:04:21 +08:00
1 11 61 " foo.adb " )
2020-10-19 12:14:37 +02:00
( ada " foo.adb:61:11: [...] in call to size declared at foo.ads:11 "
2011-05-08 21:22:05 -04:00
52 nil 11 " foo.ads " )
2020-10-19 12:14:37 +02:00
( ada " 0x8008621 main+16 at error.c:17 "
2011-05-08 21:22:05 -04:00
23 nil 17 " error.c " )
;; aix
2020-10-19 12:14:37 +02:00
( aix " ****** Error number 140 in line 8 of file errors.c ****** "
2011-05-08 21:22:05 -04:00
25 nil 8 " errors.c " )
;; ant
2020-10-19 12:14:37 +02:00
( ant " [javac] /src/DataBaseTestCase.java:27: unreported exception ... "
2019-10-31 21:39:01 +03:00
13 nil 27 " /src/DataBaseTestCase.java " 2 )
2020-10-19 12:14:37 +02:00
( ant " [javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally "
2019-10-31 21:39:01 +03:00
13 nil 49 " /src/DataBaseTestCase.java " 1 )
2020-10-19 12:14:37 +02:00
( ant " [jikes] foo.java:3:5:7:9: blah blah "
2019-10-31 21:39:01 +03:00
14 ( 5 . 10 ) ( 3 . 7 ) " foo.java " 2 )
2020-10-19 12:14:37 +02:00
( ant " [javac] c:/cygwin/Test.java:12: error: foo: bar "
2019-10-31 21:39:01 +03:00
9 nil 12 " c:/cygwin/Test.java " 2 )
2020-10-19 12:14:37 +02:00
( ant " [javac] c: \\ cygwin \\ Test.java:87: error: foo: bar "
2019-10-31 21:39:01 +03:00
9 nil 87 " c: \\ cygwin \\ Test.java " 2 )
;; Checkstyle error, but ant reports a warning (note additional
;; severity level after task name)
2020-10-19 12:14:37 +02:00
( ant " [checkstyle] [ERROR] /src/Test.java:38: warning: foo "
2019-10-31 21:39:01 +03:00
22 nil 38 " /src/Test.java " 1 )
2011-05-08 21:22:05 -04:00
;; bash
2020-10-19 12:14:37 +02:00
( bash " a.sh: line 1: ls-l: command not found "
2011-05-08 21:22:05 -04:00
1 nil 1 " a.sh " )
;; borland
2020-10-19 12:14:37 +02:00
( borland " Error ping.c 15: Unable to open include file 'sys/types.h' "
2011-05-08 21:22:05 -04:00
1 nil 15 " ping.c " )
2020-10-19 12:14:37 +02:00
( borland " Warning pong.c 68: Call to function 'func' with no prototype "
2011-05-08 21:22:05 -04:00
1 nil 68 " pong.c " )
2020-10-19 12:14:37 +02:00
( borland " Error E2010 ping.c 15: Unable to open include file 'sys/types.h' "
2011-05-08 21:22:05 -04:00
1 nil 15 " ping.c " )
2020-10-19 12:14:37 +02:00
( borland
" Warning W1022 pong.c 68: Call to function 'func' with no prototype "
2011-05-08 21:22:05 -04:00
1 nil 68 " pong.c " )
;; caml
2020-10-19 12:14:37 +02:00
( python-tracebacks-and-caml
" File \" foobar.ml \" , lines 5-8, characters 20-155: blah blah "
2011-12-03 11:04:21 +08:00
1 ( 20 . 156 ) ( 5 . 8 ) " foobar.ml " )
2020-10-19 12:14:37 +02:00
( python-tracebacks-and-caml
" File \" F: \\ ocaml \\ sorting.ml \" , line 65, characters 2-145: \n Warning 26: unused variable equ. "
2011-12-03 11:04:21 +08:00
1 ( 2 . 146 ) 65 " F: \\ ocaml \\ sorting.ml " )
2020-10-19 12:14:37 +02:00
( python-tracebacks-and-caml
" File \" /usr/share/gdesklets/display/TargetGauge.py \" , line 41, in add_children "
2011-05-08 21:22:05 -04:00
1 nil 41 " /usr/share/gdesklets/display/TargetGauge.py " )
2020-10-19 12:14:37 +02:00
( python-tracebacks-and-caml
" File \\ lib \\ python \\ Products \\ PythonScripts \\ PythonScript.py, line 302, in _exec "
2011-05-08 21:22:05 -04:00
1 nil 302 " \\ lib \\ python \\ Products \\ PythonScripts \\ PythonScript.py " )
2020-10-19 12:14:37 +02:00
( python-tracebacks-and-caml
" File \" /tmp/foo.py \" , line 10 "
2011-05-08 21:22:05 -04:00
1 nil 10 " /tmp/foo.py " )
2016-12-10 21:39:55 +01:00
;; clang-include
2020-10-19 12:14:37 +02:00
( clang-include " In file included from foo.cpp:2: "
2016-12-10 21:39:55 +01:00
1 nil 2 " foo.cpp " 0 )
2016-04-23 03:10:46 +02:00
;; cmake cmake-info
2020-10-19 12:14:37 +02:00
( cmake " CMake Error at CMakeLists.txt:23 (hurz): "
2016-04-23 03:10:46 +02:00
1 nil 23 " CMakeLists.txt " )
2020-10-19 12:14:37 +02:00
( cmake " CMake Warning at cmake/modules/UseUG.cmake:73 (find_package): "
2016-04-23 03:10:46 +02:00
1 nil 73 " cmake/modules/UseUG.cmake " )
2020-10-19 12:14:37 +02:00
( cmake-info " cmake/modules/DuneGridMacros.cmake:19 (include) "
2016-04-23 03:10:46 +02:00
1 nil 19 " cmake/modules/DuneGridMacros.cmake " )
2011-05-08 21:22:05 -04:00
;; comma
2020-10-19 12:14:37 +02:00
( comma " \" foo.f \" , line 3: Error: syntax error near end of statement "
2011-05-08 21:22:05 -04:00
1 nil 3 " foo.f " )
2020-10-19 12:14:37 +02:00
( comma " \" vvouch.c \" , line 19.5: 1506-046 (S) Syntax error. "
2011-12-03 11:04:21 +08:00
1 5 19 " vvouch.c " )
2020-10-19 12:14:37 +02:00
( comma " \" foo.c \" , line 32 pos 1; (E) syntax error; unexpected symbol: \" lossage \" "
2011-12-03 11:04:21 +08:00
1 1 32 " foo.c " )
2020-10-19 12:14:37 +02:00
( comma " \" foo.adb \" , line 2(11): warning: file name does not match ... "
2011-12-03 11:04:21 +08:00
1 11 2 " foo.adb " )
2020-10-19 12:14:37 +02:00
( comma
" \" src/swapping.c \" , line 30.34: 1506-342 (W) \" /* \" detected in comment. "
2011-12-03 11:04:21 +08:00
1 34 30 " src/swapping.c " )
2011-05-08 21:22:05 -04:00
;; cucumber
2020-10-19 12:14:37 +02:00
( cucumber " Scenario: undefined step # features/cucumber.feature:3 "
2011-05-08 21:22:05 -04:00
29 nil 3 " features/cucumber.feature " )
2020-11-24 12:05:47 +01:00
;; This rule is actually handled by the `cucumber' pattern but when
;; `omake' is included, then `gnu' matches it first.
2020-10-19 12:14:37 +02:00
( gnu " /home/gusev/.rvm/foo/bar.rb:500:in `_wrap_assertion' "
2011-05-08 21:22:05 -04:00
1 nil 500 " /home/gusev/.rvm/foo/bar.rb " )
;; edg-1 edg-2
2020-10-19 12:14:37 +02:00
( edg-1 " build/intel/debug/../../../struct.cpp(42): error: identifier \" foo \" is undefined "
2011-05-08 21:22:05 -04:00
1 nil 42 " build/intel/debug/../../../struct.cpp " )
2020-10-19 12:14:37 +02:00
( edg-1 " build/intel/debug/struct.cpp(44): warning #1011: missing return statement at end of "
2011-05-08 21:22:05 -04:00
1 nil 44 " build/intel/debug/struct.cpp " )
2020-10-19 12:14:37 +02:00
( edg-1 " build/intel/debug/iptr.h(302): remark #981: operands are evaluated in unspecified order "
2011-05-08 21:22:05 -04:00
1 nil 302 " build/intel/debug/iptr.h " )
2020-10-19 12:14:37 +02:00
( edg-2 " detected during ... at line 62 of \" build/intel/debug/../../../trace.h \" "
2011-05-08 21:22:05 -04:00
31 nil 62 " build/intel/debug/../../../trace.h " )
;; epc
2020-10-19 12:14:37 +02:00
( epc " Error 24 at (2:progran.f90) : syntax error "
2011-05-08 21:22:05 -04:00
1 nil 2 " progran.f90 " )
;; ftnchek
2020-10-19 12:14:37 +02:00
( ftnchek " Dummy arg W in module SUBA line 8 file arrayclash.f is array "
2011-05-08 21:22:05 -04:00
32 nil 8 " arrayclash.f " )
2020-10-19 12:14:37 +02:00
( ftnchek " L4 used at line 55 file test/assign.f; never set "
2011-05-08 21:22:05 -04:00
16 nil 55 " test/assign.f " )
2020-10-19 12:14:37 +02:00
( ftnchek
" Warning near line 10 file arrayclash.f: Module contains no executable "
2011-05-08 21:22:05 -04:00
1 nil 10 " arrayclash.f " )
2020-10-19 12:14:37 +02:00
( ftnchek " Nonportable usage near line 31 col 9 file assign.f: mixed default and explicit "
2011-12-03 11:04:21 +08:00
24 9 31 " assign.f " )
2011-05-08 21:22:05 -04:00
;; iar
2020-10-19 12:14:37 +02:00
( iar " \" foo.c \" ,3 Error[32]: Error message "
2011-05-08 21:22:05 -04:00
1 nil 3 " foo.c " )
2020-10-19 12:14:37 +02:00
( iar " \" foo.c \" ,3 Warning[32]: Error message "
2011-05-08 21:22:05 -04:00
1 nil 3 " foo.c " )
;; ibm
2020-10-19 12:14:37 +02:00
( ibm " foo.c(2:0) : informational EDC0804: Function foo is not referenced. "
2011-12-03 11:04:21 +08:00
1 0 2 " foo.c " )
2020-10-19 12:14:37 +02:00
( ibm " foo.c(3:8) : warning EDC0833: Implicit return statement encountered. "
2011-12-03 11:04:21 +08:00
1 8 3 " foo.c " )
2020-10-19 12:14:37 +02:00
( ibm " foo.c(5:5) : error EDC0350: Syntax error. "
2011-12-03 11:04:21 +08:00
1 5 5 " foo.c " )
2011-05-08 21:22:05 -04:00
;; irix
2020-10-19 12:14:37 +02:00
( irix " ccom: Error: foo.c, line 2: syntax error "
2011-05-08 21:22:05 -04:00
1 nil 2 " foo.c " )
2020-10-19 12:14:37 +02:00
( irix " cc: Severe: /src/Python-2.3.3/Modules/_curses_panel.c, line 17: Cannot find file <panel.h> ... "
2011-05-08 21:22:05 -04:00
1 nil 17 " /src/Python-2.3.3/Modules/_curses_panel.c " )
2020-10-19 12:14:37 +02:00
( irix " cc: Info: foo.c, line 27: ... "
2011-05-08 21:22:05 -04:00
1 nil 27 " foo.c " )
2020-10-19 12:14:37 +02:00
( irix
" cfe: Warning 712: foo.c, line 2: illegal combination of pointer and ... "
2011-05-08 21:22:05 -04:00
1 nil 2 " foo.c " )
2020-10-19 12:14:37 +02:00
( irix
" cfe: Warning 600: xfe.c: 170: Not in a conditional directive while ... "
2011-05-08 21:22:05 -04:00
1 nil 170 " xfe.c " )
2020-10-19 12:14:37 +02:00
( irix " /usr/lib/cmplrs/cc/cfe: Error: foo.c: 1: blah blah "
2011-05-08 21:22:05 -04:00
1 nil 1 " foo.c " )
2020-10-19 12:14:37 +02:00
( irix " /usr/lib/cmplrs/cc/cfe: warning: foo.c: 1: blah blah "
2011-05-08 21:22:05 -04:00
1 nil 1 " foo.c " )
2020-10-19 12:14:37 +02:00
( irix " foo bar: baz.f, line 27: ... "
2011-05-08 21:22:05 -04:00
1 nil 27 " baz.f " )
;; java
2020-10-19 12:14:37 +02:00
( java " \t at org.foo.ComponentGateway.doGet(ComponentGateway.java:172) "
2011-05-08 21:22:05 -04:00
5 nil 172 " ComponentGateway.java " )
2020-10-19 12:14:37 +02:00
( java " \t at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) "
2011-05-08 21:22:05 -04:00
5 nil 740 " HttpServlet.java " )
2020-10-19 12:14:37 +02:00
( java " ==1332== at 0x4040743C: System::getErrorString() (../src/Lib/System.cpp:217) "
2011-05-08 21:22:05 -04:00
13 nil 217 " ../src/Lib/System.cpp " )
2020-10-19 12:14:37 +02:00
( java " ==1332== by 0x8008621: main (vtest.c:180) "
2011-05-08 21:22:05 -04:00
13 nil 180 " vtest.c " )
2020-04-01 03:01:23 +03:00
;; javac
2020-10-19 12:14:37 +02:00
( javac
" /src/Test.java:5: ';' expected \n foo foo \n ^ \n "
2020-11-06 17:10:55 +01:00
1 16 5 " /src/Test.java " 2 )
2020-10-19 12:14:37 +02:00
( javac
" e: \\ src \\ Test.java:7: warning: ';' expected \n foo foo \n ^ \n "
2020-11-06 17:10:55 +01:00
1 11 7 " e: \\ src \\ Test.java " 1 )
2011-05-08 21:22:05 -04:00
;; jikes-file jikes-line
2020-10-19 12:14:37 +02:00
( jikes-file
" Found 2 semantic errors compiling \" ../javax/swing/BorderFactory.java \" : "
2011-05-08 21:22:05 -04:00
1 nil nil " ../javax/swing/BorderFactory.java " )
2020-10-19 12:14:37 +02:00
( jikes-file " Issued 1 semantic warning compiling \" java/awt/Toolkit.java \" : "
2011-05-08 21:22:05 -04:00
1 nil nil " java/awt/Toolkit.java " )
;; gcc-include
2020-10-19 12:14:37 +02:00
( gcc-include " In file included from /usr/include/c++/3.3/backward/warn.h:4, "
2011-05-08 21:22:05 -04:00
1 nil 4 " /usr/include/c++/3.3/backward/warn.h " )
2020-10-19 12:14:37 +02:00
( gcc-include
" from /usr/include/c++/3.3/backward/iostream.h:31:0, "
2011-12-03 11:04:21 +08:00
1 0 31 " /usr/include/c++/3.3/backward/iostream.h " )
2020-10-19 12:14:37 +02:00
( gcc-include " from test_clt.cc:1: "
2011-05-08 21:22:05 -04:00
1 nil 1 " test_clt.cc " )
2019-10-05 12:29:04 -07:00
;; gmake
2020-10-19 12:14:37 +02:00
( gmake " make: *** [Makefile:20: all] Error 2 " 12 nil 20 " Makefile " 0 )
( gmake " make[4]: *** [sub/make.mk:19: all] Error 127 " 15 nil 19
" sub/make.mk " 0 )
( gmake " gmake[4]: *** [sub/make.mk:19: all] Error 2 " 16 nil 19
" sub/make.mk " 0 )
( gmake " gmake-4.3[4]: *** [make.mk:1119: all] Error 2 " 20 nil 1119
" make.mk " 0 )
( gmake " Make-4.3: *** [make.INC:1119: dir/all] Error 2 " 16 nil 1119
" make.INC " 0 )
2011-05-08 21:22:05 -04:00
;; gnu
2020-10-19 12:14:37 +02:00
( gnu " foo.c:8: message " 1 nil 8 " foo.c " )
( gnu " ../foo.c:8: W: message " 1 nil 8 " ../foo.c " )
( gnu " /tmp/foo.c:8:warning message " 1 nil 8 " /tmp/foo.c " )
( gnu " foo/bar.py:8: FutureWarning message " 1 nil 8 " foo/bar.py " )
( gnu " foo.py:8: RuntimeWarning message " 1 nil 8 " foo.py " )
( gnu " foo.c:8:I: message " 1 nil 8 " foo.c " )
( gnu " foo.c:8.23: note: message " 1 23 8 " foo.c " )
( gnu " foo.c:8.23: info: message " 1 23 8 " foo.c " )
( gnu " foo.c:8:23:information: message " 1 23 8 " foo.c " )
( gnu " foo.c:8.23-45: Informational: message " 1 ( 23 . 46 ) ( 8 . nil ) " foo.c " )
( gnu " foo.c:8-23: message " 1 nil ( 8 . 23 ) " foo.c " )
2013-01-13 17:08:13 -08:00
;; The next one is not in the GNU standards AFAICS.
;; Here we seem to interpret it as LINE1-LINE2.COL2.
2020-10-19 12:14:37 +02:00
( gnu " foo.c:8-45.3: message " 1 ( nil . 4 ) ( 8 . 45 ) " foo.c " )
( gnu " foo.c:8.23-9.1: message " 1 ( 23 . 2 ) ( 8 . 9 ) " foo.c " )
( gnu " jade:dbcommon.dsl:133:17:E: missing argument for function call "
2011-12-03 11:04:21 +08:00
1 17 133 " dbcommon.dsl " )
2020-10-19 12:14:37 +02:00
( gnu " G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found. "
2011-05-08 21:22:05 -04:00
1 nil 54 " G:/cygwin/dev/build-myproj.xml " )
2020-10-19 12:14:37 +02:00
( gnu " file:G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found. "
2011-05-08 21:22:05 -04:00
1 nil 54 " G:/cygwin/dev/build-myproj.xml " )
2020-10-19 12:14:37 +02:00
( gnu " {standard input}:27041: Warning: end of file not at end of a line; newline inserted "
2011-05-08 21:22:05 -04:00
1 nil 27041 " {standard input} " )
2020-10-19 12:14:37 +02:00
( gnu " boost/container/detail/flat_tree.hpp:589:25: [ skipping 5 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ] "
2019-10-04 15:29:31 +02:00
1 25 589 " boost/container/detail/flat_tree.hpp " 0 )
2019-10-29 23:06:20 +03:00
;; gradle-kotlin
2020-10-19 12:14:37 +02:00
( gradle-kotlin
" e: /src/Test.kt: (34, 15): foo: bar " 4 15 34 " /src/Test.kt " 2 )
( gradle-kotlin
" w: /src/Test.kt: (11, 98): foo: bar " 4 98 11 " /src/Test.kt " 1 )
( gradle-kotlin
" e: e:/cygwin/src/Test.kt: (34, 15): foo: bar "
4 15 34 " e:/cygwin/src/Test.kt " 2 )
( gradle-kotlin
" w: e:/cygwin/src/Test.kt: (11, 98): foo: bar "
4 98 11 " e:/cygwin/src/Test.kt " 1 )
( gradle-kotlin
" e: e: \\ src \\ Test.kt: (34, 15): foo: bar " 4 15 34 " e: \\ src \\ Test.kt " 2 )
( gradle-kotlin
" w: e: \\ src \\ Test.kt: (11, 98): foo: bar " 4 98 11 " e: \\ src \\ Test.kt " 1 )
2014-08-13 21:17:21 +02:00
;; Guile
2020-10-19 12:14:37 +02:00
( guile-file " In foo.scm: \n " 1 nil nil " foo.scm " )
( guile-line " 63:4 [call-with-prompt prompt0 ...] " 1 4 63 nil )
( guile-line " 1038: 1 [main ( \" gud-break.scm \" )] " 1 1 1038 nil )
2011-05-08 21:22:05 -04:00
;; lcc
2020-10-19 12:14:37 +02:00
( lcc " E, file.cc(35,52) Illegal operation on pointers " 1 52 35 " file.cc " )
( lcc " W, file.cc(36,52) blah blah " 1 52 36 " file.cc " )
2011-05-08 21:22:05 -04:00
;; makepp
2020-10-19 12:14:37 +02:00
( makepp " makepp: Scanning `/foo/bar.c' " 19 nil nil " /foo/bar.c " )
( makepp " makepp: warning: bla bla `/foo/bar.c' and `/foo/bar.h' "
27 nil nil " /foo/bar.c " )
( makepp " makepp: bla bla `/foo/Makeppfile:12' bla "
18 nil 12 " /foo/Makeppfile " )
( nil " makepp: bla bla `/foo/bar.c' and `/foo/bar.h' "
35 nil nil " /foo/bar.h " )
2011-05-08 21:22:05 -04:00
;; maven
2020-10-19 12:14:37 +02:00
( maven " FooBar.java:[111,53] no interface expected here "
2015-05-19 00:02:39 +03:00
1 53 111 " FooBar.java " 2 )
2020-10-19 12:14:37 +02:00
( maven " [ERROR] /Users/cinsk/hello.java:[651,96] ';' expected "
2015-05-19 00:02:39 +03:00
15 96 651 " /Users/cinsk/hello.java " 2 ) ;Bug#11517.
2020-10-19 12:14:37 +02:00
( maven " [WARNING] /foo/bar/Test.java:[27,43] unchecked conversion "
2015-05-19 00:02:39 +03:00
11 43 27 " /foo/bar/Test.java " 1 ) ;Bug#20556
2011-05-08 21:22:05 -04:00
;; mips-1 mips-2
2020-10-19 12:14:37 +02:00
( mips-1 " TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation "
2011-05-08 21:22:05 -04:00
11 nil 255 " solomon.c " )
2020-10-19 12:14:37 +02:00
( mips-1 " TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation "
2011-05-08 21:22:05 -04:00
70 nil 93 " solomo.c " )
2020-10-19 12:14:37 +02:00
( mips-2 " name defined but never used: LinInt in cmap_calc.c(199) "
2011-05-08 21:22:05 -04:00
40 nil 199 " cmap_calc.c " )
;; msft
2020-10-19 12:14:37 +02:00
( msft " keyboard handler.c(537) : warning C4005: 'min' : macro redefinition "
2011-05-08 21:22:05 -04:00
1 nil 537 " keyboard handler.c " )
2020-10-19 12:14:37 +02:00
( msft
" d: \\ tmp \\ test.c(23) : error C2143: syntax error : missing ';' before 'if' "
2011-05-08 21:22:05 -04:00
1 nil 23 " d: \\ tmp \\ test.c " )
2020-10-19 12:14:37 +02:00
( msft " d: \\ tmp \\ test.c(1145) : see declaration of 'nsRefPtr' "
2011-05-08 21:22:05 -04:00
1 nil 1145 " d: \\ tmp \\ test.c " )
2020-10-19 12:14:37 +02:00
( msft " 1>test_main.cpp(29): error C2144: syntax error : 'int' should be preceded by ';' "
2012-10-14 09:40:05 +02:00
3 nil 29 " test_main.cpp " )
2020-10-19 12:14:37 +02:00
( msft " 1>test_main.cpp(29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int "
2012-10-14 09:40:05 +02:00
3 nil 29 " test_main.cpp " )
2020-10-19 12:14:37 +02:00
( msft " C: \\ tmp \\ test.cpp(101,11): error C4101: 'bias0123': unreferenced local variable [C: \\ tmp \\ project.vcxproj] "
2020-07-26 15:24:59 +02:00
1 11 101 " C: \\ tmp \\ test.cpp " )
2011-05-08 21:22:05 -04:00
;; watcom
2020-10-19 12:14:37 +02:00
( watcom
" .. \\ src \\ ctrl \\ lister.c(109): Error! E1009: Expecting ';' but found '{' "
2015-09-17 15:55:56 -07:00
1 nil 109 " .. \\ src \\ ctrl \\ lister.c " )
2020-10-19 12:14:37 +02:00
( watcom " .. \\ src \\ ctrl \\ lister.c(120): Warning! W201: Unreachable code "
2015-09-17 15:55:56 -07:00
1 nil 120 " .. \\ src \\ ctrl \\ lister.c " )
2020-02-15 16:08:14 +01:00
;; omake
2020-10-19 12:14:37 +02:00
;; FIXME: This doesn't actually test the omake rule.
( gnu " alpha.c:5:15: error: expected ';' after expression "
2020-02-15 16:08:14 +01:00
1 15 5 " alpha.c " )
2011-05-08 21:22:05 -04:00
;; oracle
2020-10-19 12:14:37 +02:00
( oracle " Semantic error at line 528, column 5, file erosacqdb.pc: "
2011-12-03 11:04:21 +08:00
1 5 528 " erosacqdb.pc " )
2020-10-19 12:14:37 +02:00
( oracle " Error at line 41, column 10 in file /usr/src/sb/ODBI_BHP.hpp "
2011-12-03 11:04:21 +08:00
1 10 41 " /usr/src/sb/ODBI_BHP.hpp " )
2020-10-19 12:14:37 +02:00
( oracle
" PCC-02150: error at line 49, column 27 in file /usr/src/sb/ODBI_dxfgh.pc "
2011-12-03 11:04:21 +08:00
1 27 49 " /usr/src/sb/ODBI_dxfgh.pc " )
2020-10-19 12:14:37 +02:00
( oracle " PCC-00003: invalid SQL Identifier at column name in line 12 of file /usr/src/sb/ODBI_BHP.hpp "
2011-05-08 21:22:05 -04:00
1 nil 12 " /usr/src/sb/ODBI_BHP.hpp " )
2020-10-19 12:14:37 +02:00
( oracle " PCC-00004: mismatched IF/ELSE/ENDIF block at line 27 in file /usr/src/sb/ODBI_BHP.hpp "
2011-05-08 21:22:05 -04:00
1 nil 27 " /usr/src/sb/ODBI_BHP.hpp " )
2020-10-19 12:14:37 +02:00
( oracle " PCC-02151: line 21 column 40 file /usr/src/sb/ODBI_BHP.hpp: "
2011-12-03 11:04:21 +08:00
1 40 21 " /usr/src/sb/ODBI_BHP.hpp " )
2011-05-08 21:22:05 -04:00
;; perl
2020-10-19 12:14:37 +02:00
( perl " syntax error at automake line 922, near \" ':' \" "
2011-05-08 21:22:05 -04:00
14 nil 922 " automake " )
2020-10-19 12:14:37 +02:00
( perl " Died at test.pl line 27. "
2011-05-08 21:22:05 -04:00
6 nil 27 " test.pl " )
2020-10-19 12:14:37 +02:00
( perl " store::odrecall('File_A', 'x2') called at store.pm line 90 "
2011-05-08 21:22:05 -04:00
40 nil 90 " store.pm " )
2020-10-19 12:14:37 +02:00
( perl
" \t (in cleanup) something bad at foo.pl line 3 during global destruction. "
2011-05-08 21:22:05 -04:00
29 nil 3 " foo.pl " )
2020-10-19 12:14:37 +02:00
( perl " GLib-GObject-WARNING **: /build/buildd/glib2.0-2.14.5/gobject/gsignal.c:1741: instance `0x8206790' has no handler with id `1234' at t-compilation-perl-gtk.pl line 3. "
2011-05-08 21:22:05 -04:00
130 nil 3 " t-compilation-perl-gtk.pl " )
;; php
2020-10-19 12:14:37 +02:00
( php " Parse error: parse error, unexpected $ in main.php on line 59 "
2011-05-08 21:22:05 -04:00
1 nil 59 " main.php " )
2020-10-19 12:14:37 +02:00
( php " Fatal error: Call to undefined function: mysql_pconnect() in db.inc on line 66 "
2011-05-08 21:22:05 -04:00
1 nil 66 " db.inc " )
2020-10-19 12:14:37 +02:00
;; ruby (uses gnu)
( gnu " plain-exception.rb:7:in `fun' : unhandled exception "
2011-05-08 21:22:05 -04:00
1 nil 7 " plain-exception.rb " )
2020-10-19 12:14:37 +02:00
( gcc-include
" \t from plain-exception.rb:3:in `proxy' " 2 nil 3 " plain-exception.rb " )
( gcc-include " \t from plain-exception.rb:12 " 2 nil 12 " plain-exception.rb " )
2011-05-08 21:22:05 -04:00
;; ruby-Test::Unit
;; FIXME
2020-10-19 12:14:37 +02:00
( ruby-Test::Unit " [examples/test-unit.rb:28:in `here_is_a_deep_assert' "
2011-05-08 21:22:05 -04:00
5 nil 28 " examples/test-unit.rb " )
2020-10-19 12:14:37 +02:00
( ruby-Test::Unit " examples/test-unit.rb:19:in `test_a_deep_assert' ]: "
2011-05-08 21:22:05 -04:00
6 nil 19 " examples/test-unit.rb " )
2020-10-19 12:14:37 +02:00
( gnu " examples/test-unit.rb:10:in `test_assert_raise' "
2011-05-08 21:22:05 -04:00
1 nil 10 " examples/test-unit.rb " )
;; rxp
2020-10-19 12:14:37 +02:00
( rxp " Error: Mismatched end tag: expected </geroup>, got </group> \n in unnamed entity at line 71 char 8 of file:///home/reto/test/group.xml "
2011-12-03 11:04:21 +08:00
1 8 71 " /home/reto/test/group.xml " )
2020-10-19 12:14:37 +02:00
( rxp " Warning: Start tag for undeclared element geroup \n in unnamed entity at line 4 char 8 of file:///home/reto/test/group.xml "
2011-12-03 11:04:21 +08:00
1 8 4 " /home/reto/test/group.xml " )
2020-09-22 02:04:15 +02:00
;; shellcheck
2020-10-19 12:14:37 +02:00
( shellcheck " In autogen.sh line 48: "
2020-09-22 02:04:15 +02:00
1 nil 48 " autogen.sh " )
2011-05-08 21:22:05 -04:00
;; sparc-pascal-file sparc-pascal-line sparc-pascal-example
2020-10-19 12:14:37 +02:00
( sparc-pascal-file " Thu May 14 10:46:12 1992 mom3.p: "
2011-05-08 21:22:05 -04:00
1 nil nil " mom3.p " )
;; sun
2020-10-19 12:14:37 +02:00
( sun " cc-1020 CC: REMARK File = CUI_App.h, Line = 735 "
2011-05-08 21:22:05 -04:00
13 nil 735 " CUI_App.h " )
2020-10-19 12:14:37 +02:00
( sun " cc-1070 cc: WARNING File = linkl.c, Line = 38 "
2011-05-08 21:22:05 -04:00
13 nil 38 " linkl.c " )
2020-10-19 12:14:37 +02:00
( sun " cf90-113 f90comp: ERROR NSE, File = Hoved.f90, Line = 16, Column = 3 "
2011-12-03 11:04:21 +08:00
18 3 16 " Hoved.f90 " )
2011-05-08 21:22:05 -04:00
;; sun-ada
2020-10-19 12:14:37 +02:00
( sun-ada " /home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: \" , \" inserted "
2011-12-03 11:04:21 +08:00
1 6 361 " /home3/xdhar/rcds_rc/main.a " )
2011-05-08 21:22:05 -04:00
;; 4bsd
2020-10-19 12:14:37 +02:00
( edg-1 " /usr/src/foo/foo.c(8): warning: w may be used before set "
2011-05-08 21:22:05 -04:00
1 nil 8 " /usr/src/foo/foo.c " )
2020-10-19 12:14:37 +02:00
( edg-1 " /usr/src/foo/foo.c(9): error: w is used before set "
2011-05-08 21:22:05 -04:00
1 nil 9 " /usr/src/foo/foo.c " )
2020-10-19 12:14:37 +02:00
( 4bsd " strcmp: variable # of args. llib-lc(359) :: /usr/src/foo/foo.c(8) "
2011-05-08 21:22:05 -04:00
44 nil 8 " /usr/src/foo/foo.c " )
2020-10-19 12:14:37 +02:00
( 4bsd " bloofle defined( /users/wolfgang/foo.c(4) ), but never used "
2011-05-08 21:22:05 -04:00
18 nil 4 " /users/wolfgang/foo.c " )
;; perl--Pod::Checker
;; FIXME
;; *** ERROR: Spurious text after =cut at line 193 in file foo.pm
;; *** ERROR: =over on line 37 without closing =back at line EOF in file bar.pm
;; *** ERROR: =over on line 1 without closing =back (at head1) at line 3 in file x.pod
;; perl--Test
2020-10-19 12:14:37 +02:00
( perl--Test " # Failed test 1 in foo.t at line 6 "
2011-05-08 21:22:05 -04:00
1 nil 6 " foo.t " )
;; perl--Test::Harness
2020-10-19 12:14:37 +02:00
( perl--Test2 " NOK 1# Test 1 got: \" 1234 \" (t/foo.t at line 46) "
2011-05-08 21:22:05 -04:00
1 nil 46 " t/foo.t " )
;; weblint
2020-10-19 12:14:37 +02:00
( weblint " index.html (13:1) Unknown element <fdjsk> "
2011-12-03 11:04:21 +08:00
1 1 13 " index.html " ) )
2011-05-08 21:22:05 -04:00
" List of tests for `compilation-error-regexp-alist' .
2020-10-19 12:14:37 +02:00
Each element has the form ( RULE STR POS COLUMN LINE FILENAME
[ TYPE ] ) , where RULE is the rule ( as a symbol ) , STR is an error
string, POS is the position of the error in STR, COLUMN and LINE
are the reported column and line numbers ( or nil ) for that error,
FILENAME is the reported filename, and TYPE is 0 for an
information message, 1 for a warning, and 2 for an error.
2011-05-08 21:22:05 -04:00
LINE can also be of the form ( LINE . END-LINE ) meaning a range of
lines. COLUMN can also be of the form ( COLUMN . END-COLUMN )
meaning a range of columns starting on LINE and ending on
2016-12-10 21:36:15 +01:00
END-LINE, if that matched. TYPE can be left out, in which case
any message type is accepted. " )
2011-05-08 21:22:05 -04:00
2018-07-09 16:56:47 -04:00
( defconst compile-tests--grep-regexp-testcases
;; Bug#32051.
2020-10-19 12:14:37 +02:00
' ( ( nil
" c:/Users/my.name/src/project \\ src \\ kbhit.hpp \0 \ 29:#include <termios.h> "
2018-07-09 16:56:47 -04:00
1 nil 29 " c:/Users/my.name/src/project \\ src \\ kbhit.hpp " )
2020-10-19 12:14:37 +02:00
( nil
" d:/gnu/emacs/branch/src/callproc.c \0 \ 214:#ifdef DOS_NT "
2018-07-09 16:56:47 -04:00
1 nil 214 " d:/gnu/emacs/branch/src/callproc.c " )
2020-10-19 12:14:37 +02:00
( nil
" /gnu/emacs/branch/src/callproc.c \0 \ 214:#ifdef DOS_NT "
2018-07-09 16:56:47 -04:00
1 nil 214 " /gnu/emacs/branch/src/callproc.c " ) )
" List of tests for `grep-regexp-list' .
The format is the same as ` compile-tests--test-regexps-data ', but
the match is expected to be the same when NUL bytes are replaced
with colon. " )
( defconst compile-tests--grep-regexp-tricky-testcases
;; Bug#7378.
2020-10-19 12:14:37 +02:00
' ( ( nil
" ./x11-libs---nx/3.4.0:0:C.30253.1289557929.792611.C/nx-3.4.0.exheres-0 \0 \ 42:some text "
2018-07-09 16:56:47 -04:00
1 nil 42 " ./x11-libs---nx/3.4.0:0:C.30253.1289557929.792611.C/nx-3.4.0.exheres-0 " )
2020-10-19 12:14:37 +02:00
( nil
" 2011-08-31_11:57:03_1 \0 \ 7:Date: Wed, 31 Aug 2011 11:57:03 +0000 "
2018-07-09 16:56:47 -04:00
1 nil 7 " 2011-08-31_11:57:03_1 " ) )
" List of tricky tests for `grep-regexp-list' .
Same as ` compile-tests--grep-regexp-testcases ', but these cases
can only work with the NUL byte to disambiguate colons. " )
2011-05-08 21:22:05 -04:00
( defun compile--test-error-line ( test )
2020-10-19 12:14:37 +02:00
( ert-info ( ( format " %S " test ) :prefix " testcase: " )
( erase-buffer )
( setq compilation-locs ( make-hash-table ) )
( let ( ( rule ( nth 0 test ) )
( str ( nth 1 test ) )
( pos ( nth 2 test ) )
( col ( nth 3 test ) )
( line ( nth 4 test ) )
( file ( nth 5 test ) )
( type ( nth 6 test ) ) )
( insert str )
( compilation-parse-errors ( point-min ) ( point-max ) )
( let ( ( msg ( get-text-property pos 'compilation-message ) ) )
( should msg )
( let ( ( loc ( compilation--message->loc msg ) )
end-col end-line )
( if ( consp col )
( setq end-col ( cdr col ) col ( car col ) ) )
( if ( consp line )
( setq end-line ( cdr line ) line ( car line ) ) )
( should ( equal ( compilation--loc->col loc ) col ) )
( should ( equal ( compilation--loc->line loc ) line ) )
( when file
( should ( equal ( caar ( compilation--loc->file-struct loc ) ) file ) ) )
( when end-col
( should ( equal
( car ( cadr ( nth 2 ( compilation--loc->file-struct loc ) ) ) )
end-col ) ) )
( should ( equal ( car ( nth 2 ( compilation--loc->file-struct loc ) ) )
( or end-line line ) ) )
( when type
( should ( equal type ( compilation--message->type msg ) ) ) )
( should ( equal rule ( compilation--message->rule msg ) ) ) )
msg ) ) ) )
2011-05-08 21:22:05 -04:00
( ert-deftest compile-test-error-regexps ( )
" Test the `compilation-error-regexp-alist' regexps.
The test data is in ` compile-tests--test-regexps-data '. "
( with-temp-buffer
( font-lock-mode -1 )
2019-10-04 15:23:13 +02:00
( let ( ( compilation-num-errors-found 0 )
( compilation-num-warnings-found 0 )
( compilation-num-infos-found 0 ) )
( mapc #' compile--test-error-line compile-tests--test-regexps-data )
2020-09-22 02:04:15 +02:00
( should ( eq compilation-num-errors-found 96 ) )
2020-08-13 16:36:09 +01:00
( should ( eq compilation-num-warnings-found 35 ) )
( should ( eq compilation-num-infos-found 28 ) ) ) ) )
2011-05-08 21:22:05 -04:00
2018-07-09 16:56:47 -04:00
( ert-deftest compile-test-grep-regexps ( )
" Test the `grep-regexp-alist' regexps.
The test data is in ` compile-tests--grep-regexp-testcases '. "
( with-temp-buffer
( grep-mode )
( setq buffer-read-only nil )
( font-lock-mode -1 )
( dolist ( testcase compile-tests--grep-regexp-testcases )
( let ( msg1 msg2 )
2020-10-19 12:14:37 +02:00
( setq msg1 ( compile--test-error-line testcase ) )
2018-07-09 16:56:47 -04:00
;; Make sure replacing the NUL character with a colon still matches.
2020-10-19 12:14:37 +02:00
( let ( ( testcase2 ( copy-sequence testcase ) ) )
( setf ( nth 1 testcase2 )
( string-replace " \0 " " : " ( nth 1 testcase2 ) ) )
( setq msg2 ( compile--test-error-line testcase2 ) ) )
2018-07-09 16:56:47 -04:00
( should ( equal msg1 msg2 ) ) ) )
( dolist ( testcase compile-tests--grep-regexp-tricky-testcases )
2020-10-19 12:14:37 +02:00
( compile--test-error-line testcase ) )
2019-07-12 21:57:18 +03:00
( should ( eq compilation-num-errors-found 8 ) ) ) )
2018-07-09 16:56:47 -04:00
2016-12-10 21:36:15 +01:00
;;; compile-tests.el ends here