mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 08:13:02 +00:00
Fix portability issue in the test suite.
* tests/local.at (AT_MATCHES_CHECK): New.
Based on Perl instead of Sed. Sed has too many portability
pitfalls, not ever Sed is GNU Sed.
* tests/actions.at (Fix user actions without a trailing semicolon):
Use it.
(cherry picked from commit 6617622c9a)
This commit is contained in:
committed by
Joel E. Denny
parent
42f4393a72
commit
c4fae1ef48
@@ -21,6 +21,22 @@
|
||||
m4_version_prereq([2.58])
|
||||
|
||||
|
||||
## ------------- ##
|
||||
## Basic tests. ##
|
||||
## ------------- ##
|
||||
|
||||
# AT_MATCHES_CHECK(FILE, PERL-REGEXP, COUNT)
|
||||
# ------------------------------------------
|
||||
# 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 '
|
||||
my $count = 0;
|
||||
s{$2}{ ++$count; "" }gem;
|
||||
printf "$count\n";' $1], [0], [$3
|
||||
])])
|
||||
|
||||
|
||||
## ------------------------------- ##
|
||||
## Macros decoding Bison options. ##
|
||||
## ------------------------------- ##
|
||||
|
||||
Reference in New Issue
Block a user