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 a1a77e1fcc
commit a727e7124d

View File

@@ -503,12 +503,15 @@ 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],
[# No initial empty lines.
AT_CHECK([sed -ne '/./q;=;p;' $1])
# No trailing spaces.
# FIXME: For 2.7: AT_CHECK([sed -ne '/[ ]$/{=;p;}' $1])
# No final empty lines.
AT_CHECK([sed -ne '${/^$/{=;p;};}' $1])
[AT_CHECK([perl -ne '
chomp;
print "$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space. FIXME: not ready for "maint".
# || /\s$/
)' $1
])dnl
])