tests: refactor the handling of Perl

Let's make a difference between places where Perl is required for the
test (AT_PERL_REQUIRE), and the places where it's used to run the
test, but it's not not to run the test (AT_PERL_CHECK).

* tests/local.at (AT_REQUIRE): New.
(AT_PERL_CHECK, AT_PERL_REQUIRE): New.
Use them where appropriate.

* tests/local.mk ($(TESTSUITE)): Beware not to start the line with
'-pi' if Perl is empty, as Make understands this as "it's ok to fail".
Which it is not.
This commit is contained in:
Akim Demaille
2019-10-12 12:34:10 +02:00
parent 59cb1f421c
commit c483b6593f
13 changed files with 65 additions and 39 deletions

View File

@@ -314,7 +314,7 @@ AT_TEST([x9], [%locations %code requires {#include "location.hh"} %define api.lo
# Ignore comments, YYChar (template parameter), YYPUSH_MORE(_DEFINED)?
# (constant definition), YY_\w+_INCLUDED (header guards).
# YYDEBUG (not renamed) can be read, but not changed.
AT_CHECK([["$PERL" -n -0777 -e '
AT_PERL_CHECK([[-n -0777 -e '
s{/\*.*?\*/}{}gs;
s{//.*}{}g;
s{\b((defined|if)\ YYDEBUG
@@ -347,7 +347,7 @@ AT_CHECK([["$PERL" -n -0777 -e '
print "$ARGV: invalid exported yy: $1\n";
}
}
' -- *.hh *.h || exit 77]])
' -- *.hh *.h]])
# Do this late, so that other checks have been performed.
AT_SKIP_IF_CANNOT_LINK_C_AND_CXX