forked from PCRE2Project/pcre2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validates Perl compatibility
- Loading branch information
Showing
7 changed files
with
1,633 additions
and
1,547 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,7 @@ testtemp1grep | |
testtemp2 | ||
testtemp2grep | ||
testtry | ||
testtry2 | ||
testtrygrep | ||
testSinput | ||
testbtables | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,80 @@ | ||
#! /bin/sh | ||
|
||
# Script to run the Perl-compatible PCRE2 tests through Perl. The argument can | ||
# be "1" or "4" to run just a single test. Otherwise it runs both. This script | ||
# should be run with the main PCRE2 directory current. | ||
# Script to run the Perl-compatible PCRE2 tests through Perl. For testing | ||
# with different versions of Perl, if the first argument is "-perl" then the | ||
# second is taken as the Perl command to use, and both are then removed. | ||
# | ||
# The argument can be the number of the specific Perl compatible test to run | ||
# (ex: "1", "4" or "26") to invoke just one testi, otherwise it runs all and | ||
# returns their status. | ||
|
||
if [ "$1" != "4" ]; then | ||
# This script should be run with the main PCRE2 directory current. It needs | ||
# pcre2test for Unicode version compatibility detection and so will use a | ||
# provided PCRETEST variable pointing to it. | ||
|
||
if [ -z "$PCRETEST" ]; then | ||
if [ -x pcre2test ]; then | ||
PCRETEST=$(readlink -f pcre2test) | ||
else | ||
PCRETEST=pcre2test | ||
fi | ||
fi | ||
|
||
if [ "$1" = "-perl" ]; then | ||
PERL="$2" | ||
ARGS="$1 $PERL" | ||
shift 2 | ||
else | ||
PERL=perl | ||
ARGS="" | ||
fi | ||
|
||
RC=0 | ||
|
||
if [ -z "$1" ] || [ "$1" = "1" ]; then | ||
echo "-----------------------------------------------------------------" | ||
echo "Perl test: main functionality (PCRE2 test 1)" | ||
./perltest.sh testdata/testinput1 testtry | ||
if [ $? = 0 ] ; then | ||
tail -n +3 testtry > testtry3 | ||
diff -u testdata/testoutput1 testtry3 | ||
/bin/rm -rf testtry3 | ||
if ./perltest.sh $ARGS testdata/testinput1 testtry; then | ||
tail -n +2 testtry > testtry2 | ||
diff -u testdata/testoutput1 testtry2 || RC=33 | ||
/bin/rm -rf testtry2 | ||
else | ||
RC=1 | ||
fi | ||
echo "" | ||
fi | ||
|
||
if [ "$1" != "1" ]; then | ||
if [ -z "$1" ] || [ "$1" = "4" ]; then | ||
echo "-----------------------------------------------------------------" | ||
echo "Perl test: UTF-8 and Unicode property features (PCRE2 test 4)" | ||
./perltest.sh -utf8 testdata/testinput4 testtry | ||
if [ $? = 0 ] ; then | ||
tail -n +3 testtry > testtry3 | ||
diff -u testdata/testoutput4 testtry3 | ||
/bin/rm -rf testtry3 | ||
if ./perltest.sh $ARGS -utf8 testdata/testinput4 testtry; then | ||
tail -n +2 testtry > testtry2 | ||
diff -u testdata/testoutput4 testtry2 || RC=36 | ||
/bin/rm -rf testtry2 | ||
else | ||
RC=4 | ||
fi | ||
echo "" | ||
fi | ||
|
||
if [ -z "$1" ] || [ "$1" = "26" ]; then | ||
echo "-----------------------------------------------------------------" | ||
echo "Perl test: Unicode property tests (PCRE2 test 26)" | ||
U=$($PCRETEST -C | $PERL -ne 'print "$1\n" if /\(Unicode version ([\d.]+)\)/') | ||
P=$($PERL -MUnicode::UCD -e 'print Unicode::UCD::UnicodeVersion, "\n"') | ||
if [ "$U" != "$P" ]; then | ||
echo "SKIPPED: Perl uses Unicode $P but this test expects $U" | ||
else | ||
if ./perltest.sh $ARGS testdata/testinput26 testtry; then | ||
tail -n +2 testtry > testtry2 | ||
diff -u testdata/testoutput26 testtry2 || RC=58 | ||
/bin/rm -rf testtry2 | ||
else | ||
RC=26 | ||
fi | ||
echo "" | ||
fi | ||
fi | ||
|
||
exit $RC | ||
# End |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.