From c955769a75197c3afddc9ea674439f3a49b82059 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 5 Oct 2012 09:24:59 +0200 Subject: [PATCH] tests: use $PERL instead of perl * tests/atlocal.in (PERL): New. Sort. * tests/calc.at, tests/input.at, tests/local.at, tests/regression.at, * tests/skeletons.at, tests/synclines.at, tests/torture.at: here. --- tests/atlocal.in | 20 +++++++++++--------- tests/calc.at | 2 +- tests/input.at | 8 ++++---- tests/local.at | 2 +- tests/regression.at | 6 +++--- tests/skeletons.at | 2 +- tests/synclines.at | 2 +- tests/torture.at | 6 +++--- 8 files changed, 25 insertions(+), 23 deletions(-) diff --git a/tests/atlocal.in b/tests/atlocal.in index d059d630..9a2d19f0 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -63,24 +63,26 @@ fi ## Other. ## ## ------- ## -# Are special link options needed? -LDFLAGS='@LDFLAGS@' - -# Are special libraries needed? -LIBS="$abs_top_builddir/lib/libbison.a @LIBS@ @INTLLIBS@" - # Empty if no javac was found CONF_JAVAC='@CONF_JAVAC@' # Empty if no Java VM was found CONF_JAVA='@CONF_JAVA@' -# Empty if no xsltproc was found -: ${XSLTPROC='@XSLTPROC@'} - # We need egrep. : ${EGREP='@EGREP@'} # Use simple quotes (lib/quote.c). LC_CTYPE=C export LC_CTYPE + +# Are special link options needed? +LDFLAGS='@LDFLAGS@' + +# Are special libraries needed? +LIBS="$abs_top_builddir/lib/libbison.a @LIBS@ @INTLLIBS@" + +# Empty if no xsltproc was found +: ${XSLTPROC='@XSLTPROC@'} + +: ${PERL='@PERL@'} diff --git a/tests/calc.at b/tests/calc.at index a1c11e5f..9518c3c3 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -503,7 +503,7 @@ AT_CHECK([cat stderr], 0, [expout]) # Make sure we did not introduce bad spaces. Checked here because all # the skeletons are (or should be) exercized here. m4_define([AT_CHECK_SPACES], -[AT_CHECK([perl -ne ' +[AT_CHECK([$PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. diff --git a/tests/input.at b/tests/input.at index ff1d3924..07c3e873 100644 --- a/tests/input.at +++ b/tests/input.at @@ -1194,7 +1194,7 @@ AT_DATA([empty.y], start: ''; start: ' ]]) -AT_CHECK([[perl -e "print 'start: \'';" >> empty.y || exit 77]]) +AT_CHECK([[$PERL -e "print 'start: \'';" >> empty.y || exit 77]]) AT_BISON_CHECK([empty.y], [1], [], [[empty.y:2.8-9: warning: empty character literal @@ -1209,7 +1209,7 @@ AT_DATA([two.y], start: 'ab'; start: 'ab ]]) -AT_CHECK([[perl -e "print 'start: \'ab';" >> two.y || exit 77]]) +AT_CHECK([[$PERL -e "print 'start: \'ab';" >> two.y || exit 77]]) AT_BISON_CHECK([two.y], [1], [], [[two.y:2.8-11: warning: extra characters in character literal @@ -1224,7 +1224,7 @@ AT_DATA([three.y], start: 'abc'; start: 'abc ]]) -AT_CHECK([[perl -e "print 'start: \'abc';" >> three.y || exit 77]]) +AT_CHECK([[$PERL -e "print 'start: \'abc';" >> three.y || exit 77]]) AT_BISON_CHECK([three.y], [1], [], [[three.y:2.8-12: warning: extra characters in character literal @@ -1253,7 +1253,7 @@ start: '\777' '\0' '\xfff' '\x0' # Beside we cannot even expect "echo '\0'" to output two characters # (well three with \n): at least Bash 3.2 converts the two-character # sequence "\0" into a single NUL character. -AT_CHECK([[perl -e 'print "start: \"\\\t\\\f\\\0\\\1\" ;";' >> input.y \ +AT_CHECK([[$PERL -e 'print "start: \"\\\t\\\f\\\0\\\1\" ;";' >> input.y \ || exit 77]]) AT_BISON_CHECK([input.y], [1], [], diff --git a/tests/local.at b/tests/local.at index 5c9b865e..2362e766 100644 --- a/tests/local.at +++ b/tests/local.at @@ -38,7 +38,7 @@ m4_define([m4_null_if], # Expect COUNT matches of the PERL-REGEXP in FILE. The file is # taken in "slurp" mode, i.e., one can match end-of-lines. m4_define([AT_MATCHES_CHECK], -[AT_CHECK([perl -0777 -ne ' +[AT_CHECK([$PERL -0777 -ne ' my $count = 0; s{$2}{ ++$count; "" }gem; printf "$count\n";' $1], [0], [$3 diff --git a/tests/regression.at b/tests/regression.at index 2f029939..758825c7 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -1481,17 +1481,17 @@ AT_CHECK([[grep 'syntax error,' stderr.txt]], [[0]], # Check number of default reductions in inconsistent states to be sure # syntax error is detected before unnecessary reductions are performed. -AT_CHECK([[perl -0777 -ne 'print s/inconsistent default reduction//g;' \ +AT_CHECK([[$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ < stdout.txt || exit 77]], [[0]], [[14]]) # Check number of default reductions in consistent states to be sure # it is performed before the syntax error is detected. -AT_CHECK([[perl -0777 -ne 'print s/\bconsistent default reduction//g;' \ +AT_CHECK([[$PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ < stdout.txt || exit 77]], [[0]], [[2]]) # Check number of reallocs to be sure reallocated memory isn't somehow # lost between LAC invocations. -AT_CHECK([[perl -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ +AT_CHECK([[$PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ || exit 77]], [[0]], [[3]]) AT_BISON_OPTION_POPDEFS diff --git a/tests/skeletons.at b/tests/skeletons.at index 76cf0662..e23c3bb0 100644 --- a/tests/skeletons.at +++ b/tests/skeletons.at @@ -315,7 +315,7 @@ print '@output(@,@)', "\n"; (print "garbage"x10, "\n") for (1..1000); print "${M4}_divert_pop(0)\n"; ]]) -AT_CHECK([[perl gen-skel.pl > skel.c || exit 77]]) +AT_CHECK([[$PERL gen-skel.pl > skel.c || exit 77]]) AT_DATA([[input.y]], [[%skeleton "./skel.c" diff --git a/tests/synclines.at b/tests/synclines.at index e2b7005d..041ae194 100644 --- a/tests/synclines.at +++ b/tests/synclines.at @@ -64,7 +64,7 @@ m4_define([AT_SYNCLINES_COMPILE], # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead -AT_CHECK([[perl -p -0777 - stderr <<\EOF +AT_CHECK([[$PERL -p -0777 - stderr <<\EOF s/^distcc\[\d+\] .*\n//gm; s/^([^:]+:\d+)[.:][^:]+:(.+)$/$][1:$][2/gm; s/^([^:]+:\d+):[^#]*( #error)/$][1:$][2/gm; diff --git a/tests/torture.at b/tests/torture.at index 705e131e..a5e244b6 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -125,7 +125,7 @@ EOF ]]) AT_BISON_OPTION_POPDEFS -AT_CHECK([perl -w ./gengram.pl $2 || exit 77], 0, [stdout]) +AT_CHECK([$PERL -w ./gengram.pl $2 || exit 77], 0, [stdout]) mv stdout $1 ]) @@ -214,7 +214,7 @@ main (void) EOF ]]) -AT_CHECK([perl -w ./gengram.pl $2 || exit 77], 0, [stdout]) +AT_CHECK([$PERL -w ./gengram.pl $2 || exit 77], 0, [stdout]) mv stdout $1 AT_BISON_OPTION_POPDEFS ]) @@ -350,7 +350,7 @@ main (void) EOF ]]) -AT_CHECK([perl -w ./gengram.pl $2 || exit 77], 0, [stdout]) +AT_CHECK([$PERL -w ./gengram.pl $2 || exit 77], 0, [stdout]) mv stdout $1 AT_BISON_OPTION_POPDEFS ]) -- 2.45.2