1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 23:10:47 -08:00
emacs/test/lisp
João Távora 8118f0f95f Fix three Flymake bugs when checking C header files
The first of these problems is longstanding: if an error-less B.h is
included from error-ridden A.h, flymake's legacy parser will panic
(and disable itself) since it sees a non-zero exit for a clean file.
To fix this, recommend returning 'true' in the documentation for the
check-syntax target.

Another problem was introduced by the parser rewrite.  For error
patterns spanning more than one line, point may be left in the middle
of a line and thus render other patterns useless.  Those patterns were
written for the old line-by-line parser.  To make them useful again,
move to the beginning of line in those situations.

The third problem was also longstanding and happened on newer GCC's:
The "In file included from" prefix confused
flymake-proc-get-real-file-name.  Fix this.

Also updated flymake--diag-region to fallback to highlighting a full
line less often.

Add automatic tests to check this.

* lisp/progmodes/flymake-proc.el
(flymake-proc--diagnostics-for-pattern): Fix bug when patterns
accidentally spans more than one line.  Don't create
diagnostics without error messages.
(flymake-proc-real-file-name-considering-includes): New
helper.
(flymake-proc-allowed-file-name-masks): Use it.

* lisp/progmodes/flymake.el (flymake-diag-region): Make COL
argument explicitly optional.  Only fall back to full line in extreme
cases.

* test/lisp/progmodes/flymake-tests.el
(included-c-header-files): New test.
(different-diagnostic-types): Update.

* test/lisp/progmodes/flymake-resources/Makefile
(check-syntax): Always return success (0) error code.
(CC_OPTS): Add -Wextra

* test/lisp/progmodes/flymake-resources/errors-and-warnings.c
(main): Rewrite comments.

* test/lisp/progmodes/flymake-resources/errors-and-warnings.c:
Include some dummy header files.

* test/lisp/progmodes/flymake-resources/no-problems.h: New file.

* test/lisp/progmodes/flymake-resources/some-problems.h: New file.

* doc/misc/flymake.texi (Example---Configuring a tool called
via make): Recommend adding "|| true" to the check-syntax target.
2017-10-03 14:18:55 +01:00
..
calc Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
calendar Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
emacs-lisp Fix slot typecheck in eieio-persistent 2017-09-30 16:28:00 -07:00
emulation Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
erc Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
eshell Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
gnus Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
international Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
mail Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
net ; Spelling fixes 2017-09-29 16:41:50 -07:00
progmodes Fix three Flymake bugs when checking C header files 2017-10-03 14:18:55 +01:00
textmodes Add tests for `css-current-defun-name' 2017-09-28 18:55:06 +02:00
url Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
vc Prefer HTTPS to HTTP for gnu.org 2017-10-01 19:59:01 -07:00
abbrev-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
arc-mode-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
auth-source-pass-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
auth-source-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
autorevert-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
buff-menu-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
char-fold-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
color-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
comint-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
dabbrev-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
descr-text-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
dired-aux-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
dired-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
dired-x-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
dom-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
electric-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
epg-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
faces-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
ffap-tests.el Prefer HTTPS to HTTP for gnu.org 2017-09-13 15:54:25 -07:00
filenotify-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
files-tests.el Fix new copy-directory bug with empty dirs 2017-09-20 11:50:35 -07:00
files-x-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
help-fns-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
hi-lock-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
htmlfontify-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
ibuffer-tests.el Fix 2 testsuite tests for MS-Windows 2017-09-20 10:16:11 +03:00
ido-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
imenu-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
info-xref-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
isearch-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
jit-lock-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
json-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
kmacro-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
ls-lisp-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
man-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
md4-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
minibuffer-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
mouse-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
obarray-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
ps-print-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
register-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
replace-tests.el Prefer HTTPS to HTTP for gnu.org 2017-10-01 19:59:01 -07:00
rot13-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
ses-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
shell-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
simple-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
sort-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
soundex-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
subr-tests.el Fix gensym 2017-09-18 09:00:45 -04:00
tar-mode-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
thingatpt-tests.el Prefer HTTPS to HTTP for gnu.org 2017-09-13 15:54:25 -07:00
whitespace-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
xdg-tests.el Loosen strict parsing requirement for desktop files 2017-09-25 08:45:08 -04:00
xml-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
xt-mouse-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00