emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Autoconf autotest compilation-error-regexp


From: Nikolai Weibull
Subject: Autoconf autotest compilation-error-regexp
Date: Thu, 26 Nov 2015 21:28:37 +0100

Hi!

I’ve long been trying to set up a working autoconf autotest
compilation-error-regexp.  Autoconf’s autotest has some rather funky
output that’s quite difficult to parse correctly.  In fact, it only
outputs usable paths if given the -v command-line option, in which
case the output is (where all capitals replace generic information):

1. testsuite.at:5: testing TEST TITLE ...
./testsuite.at:11: COMMAND
1. testsuite.at:5:  ok

2. testsuite.at:16: testing TEST TITLE ...
./testsuite.at:22: COMMAND
--- -   2012-11-18 13:00:01.000000000 +0100
+++ .../stdout       2012-11-18 13:00:01.000000000 +0100
DIFF OUTPUT

2. testsuite.at:16:  FAILED (testsuite.at:22)

All lines prefixed by “ORDINAL. ” are headers.  The path is always
displayed without any directory part, so this information is next to
useless for a compilation-error-regexp.  The problem is that to the
gnu compilation-error-regexp, such lines look like actual errors,
which they are not.  We therefore need a compilation-error-regexp that
makes sure that these lines are ignored.

The first line after these header lines displays the command being run
to execute the test.  If this line is followed by a diff, the test
failed.

Given this specification, this is what I’ve come up with:

(add-to-list 'compilation-error-regexp-alist-alist
             '(autotest-header
               "^\\([1-9][0-9]*\\. \\([^\n
:]+\\.at\\):\\([1-9][0-9]*\\)\\): \\(?:
FAILED\\|WARNIN\\(G\\)\\|\\(testing\\| ok\\)\\)"
               2 3 nil (4 . 5) 1))
(add-to-list 'compilation-error-regexp-alist 'autotest-header)

(add-to-list 'compilation-error-regexp-alist-alist
             '(autotest-check
               "^\\(\\([^\n :]+\\.at\\):\\([1-9][0-9]*\\)\\): "
               2 3 nil 0 1))
(add-to-list 'compilation-error-regexp-alist 'autotest-check)

(add-to-list 'compilation-error-regexp-alist-alist
             '(autotest-check-error
               "^\\(\\([^\n :]+\\.at\\):\\([1-9][0-9]*\\)\\): [^\n]+\n--- "
               2 3 nil 2 1))
(add-to-list 'compilation-error-regexp-alist 'autotest-check-error)

The first issue is that there’s no way to tell compile.el that a
compilation-error-regexp should simply be ignored.  My suggested
solution is to allow HYPERLINK to be given as -1 (or 3) and for this
to mean that the match should be ignored.

The second issue is that it seems that multi-line regexps might miss
when there’s another regexp that can match on a single line
(autotest-check-error and autotest-check).  This happens
intermittently, and I suppose it’s due to how this is being handled,
where a scan gives a match on the autotest-check regexp if not enough
output has been produced yet to be matched by the autotest-check-error
regexp.  (Autotest-check is needed so that the line won’t be matched
by the gnu regexp.)  I don’t know how to get around this, beyond
applying patches to Autoconf that make the output a bit more sane.

Anyway, any suggestions on how to proceed?

Are there better ways of handling this?

Does it seem reasonable to add support for ignoring a matched line?

Is there any way of avoiding the intermittent issues with regexps that
match depending on how much output has been produced?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]