tests: fix sed portability issues

Reported by Didier Godefroy,
<http://lists.gnu.org/archive/html/bug-bison/2012-10/msg00005.html>.

* tests/calc.at (AT_CHECK_SPACES): Use Perl.
This commit is contained in:
Akim Demaille
2012-10-05 09:20:30 +02:00
parent 9a50c55af7
commit e272d9dc80

View File

@@ -503,12 +503,15 @@ AT_CHECK([cat stderr], 0, [expout])
# Make sure we did not introduce bad spaces. Checked here because all # Make sure we did not introduce bad spaces. Checked here because all
# the skeletons are (or should be) exercized here. # the skeletons are (or should be) exercized here.
m4_define([AT_CHECK_SPACES], m4_define([AT_CHECK_SPACES],
[# No initial empty lines. [AT_CHECK([perl -ne '
AT_CHECK([sed -ne '/./q;=;p;' $1]) chomp;
# No trailing spaces. print "$.: {$_}\n"
# FIXME: For 2.7: AT_CHECK([sed -ne '/[ ]$/{=;p;}' $1]) if (# No starting/ending empty lines.
# No final empty lines. (eof || $. == 1) && /^\s*$/
AT_CHECK([sed -ne '${/^$/{=;p;};}' $1]) # No trailing space. FIXME: not ready for "maint".
# || /\s$/
)' $1
])dnl
]) ])