| 1 |
nigel |
49 |
#! /bin/sh |
| 2 |
|
|
|
| 3 |
|
|
# This file is generated by configure from RunTest.in. Make any changes |
| 4 |
|
|
# to that file. |
| 5 |
|
|
|
| 6 |
|
|
# Run PCRE tests |
| 7 |
|
|
|
| 8 |
|
|
cf=diff |
| 9 |
nigel |
53 |
testdata=@top_srcdir@/testdata |
| 10 |
nigel |
49 |
|
| 11 |
|
|
# Select which tests to run; if no selection, run all |
| 12 |
|
|
|
| 13 |
|
|
do1=no |
| 14 |
|
|
do2=no |
| 15 |
|
|
do3=no |
| 16 |
|
|
do4=no |
| 17 |
|
|
do5=no |
| 18 |
|
|
|
| 19 |
|
|
while [ $# -gt 0 ] ; do |
| 20 |
|
|
case $1 in |
| 21 |
|
|
1) do1=yes;; |
| 22 |
|
|
2) do2=yes;; |
| 23 |
|
|
3) do3=yes;; |
| 24 |
|
|
4) do4=yes;; |
| 25 |
|
|
5) do5=yes;; |
| 26 |
|
|
*) echo "Unknown test number $1"; exit 1;; |
| 27 |
|
|
esac |
| 28 |
|
|
shift |
| 29 |
|
|
done |
| 30 |
|
|
|
| 31 |
|
|
if [ "@UTF8@" = "" ] ; then |
| 32 |
nigel |
63 |
if [ $do4 = yes ] ; then |
| 33 |
|
|
echo "Can't run test 4 because UFT8 support is not configured" |
| 34 |
|
|
exit 1 |
| 35 |
|
|
fi |
| 36 |
nigel |
49 |
if [ $do5 = yes ] ; then |
| 37 |
|
|
echo "Can't run test 5 because UFT8 support is not configured" |
| 38 |
|
|
exit 1 |
| 39 |
|
|
fi |
| 40 |
|
|
fi |
| 41 |
|
|
|
| 42 |
|
|
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a\ |
| 43 |
nigel |
63 |
$do5 = no ] ; then |
| 44 |
nigel |
49 |
do1=yes |
| 45 |
|
|
do2=yes |
| 46 |
|
|
do3=yes |
| 47 |
nigel |
63 |
if [ "@UTF8@" != "" ] ; then do4=yes; fi |
| 48 |
nigel |
49 |
if [ "@UTF8@" != "" ] ; then do5=yes; fi |
| 49 |
|
|
fi |
| 50 |
|
|
|
| 51 |
nigel |
73 |
# Show which release |
| 52 |
|
|
|
| 53 |
|
|
./pcretest /dev/null |
| 54 |
|
|
|
| 55 |
nigel |
49 |
# Primary test, Perl-compatible |
| 56 |
|
|
|
| 57 |
|
|
if [ $do1 = yes ] ; then |
| 58 |
|
|
echo "Testing main functionality (Perl compatible)" |
| 59 |
nigel |
53 |
./pcretest $testdata/testinput1 testtry |
| 60 |
nigel |
49 |
if [ $? = 0 ] ; then |
| 61 |
nigel |
53 |
$cf testtry $testdata/testoutput1 |
| 62 |
nigel |
49 |
if [ $? != 0 ] ; then exit 1; fi |
| 63 |
nigel |
63 |
echo " " |
| 64 |
nigel |
49 |
else exit 1 |
| 65 |
|
|
fi |
| 66 |
|
|
fi |
| 67 |
|
|
|
| 68 |
|
|
# PCRE tests that are not Perl-compatible - API & error tests, mostly |
| 69 |
|
|
|
| 70 |
|
|
if [ $do2 = yes ] ; then |
| 71 |
|
|
echo "Testing API and error handling (not Perl compatible)" |
| 72 |
nigel |
53 |
./pcretest -i $testdata/testinput2 testtry |
| 73 |
nigel |
49 |
if [ $? = 0 ] ; then |
| 74 |
nigel |
53 |
$cf testtry $testdata/testoutput2 |
| 75 |
nigel |
49 |
if [ $? != 0 ] ; then exit 1; fi |
| 76 |
|
|
else exit 1 |
| 77 |
|
|
fi |
| 78 |
|
|
fi |
| 79 |
|
|
|
| 80 |
nigel |
63 |
if [ $do1 = yes -a $do2 = yes ] ; then |
| 81 |
nigel |
49 |
echo " " |
| 82 |
nigel |
63 |
echo "The two main tests ran OK" |
| 83 |
nigel |
49 |
echo " " |
| 84 |
|
|
fi |
| 85 |
|
|
|
| 86 |
nigel |
73 |
# Locale-specific tests, provided the "fr_FR" locale is available |
| 87 |
nigel |
49 |
|
| 88 |
nigel |
63 |
if [ $do3 = yes ] ; then |
| 89 |
nigel |
73 |
locale -a | grep '^fr_FR$' >/dev/null |
| 90 |
nigel |
49 |
if [ $? -eq 0 ] ; then |
| 91 |
nigel |
73 |
echo "Testing locale-specific features (using 'fr_FR' locale)" |
| 92 |
nigel |
63 |
./pcretest $testdata/testinput3 testtry |
| 93 |
nigel |
49 |
if [ $? = 0 ] ; then |
| 94 |
nigel |
63 |
$cf testtry $testdata/testoutput3 |
| 95 |
nigel |
49 |
if [ $? != 0 ] ; then |
| 96 |
|
|
echo " " |
| 97 |
|
|
echo "Locale test did not run entirely successfully." |
| 98 |
|
|
echo "This usually means that there is a problem with the locale" |
| 99 |
|
|
echo "settings rather than a bug in PCRE." |
| 100 |
|
|
else |
| 101 |
|
|
echo "Locale test ran OK" |
| 102 |
|
|
fi |
| 103 |
|
|
echo " " |
| 104 |
|
|
else exit 1 |
| 105 |
|
|
fi |
| 106 |
|
|
else |
| 107 |
nigel |
73 |
echo "Cannot test locale-specific features - 'fr_FR' locale not found," |
| 108 |
nigel |
49 |
echo "or the \"locale\" command is not available to check for it." |
| 109 |
|
|
echo " " |
| 110 |
|
|
fi |
| 111 |
|
|
fi |
| 112 |
|
|
|
| 113 |
|
|
# Additional tests for UTF8 support |
| 114 |
|
|
|
| 115 |
nigel |
63 |
if [ $do4 = yes ] ; then |
| 116 |
|
|
echo "Testing UTF-8 support (Perl compatible)" |
| 117 |
|
|
./pcretest $testdata/testinput4 testtry |
| 118 |
nigel |
49 |
if [ $? = 0 ] ; then |
| 119 |
nigel |
63 |
$cf testtry $testdata/testoutput4 |
| 120 |
nigel |
49 |
if [ $? != 0 ] ; then exit 1; fi |
| 121 |
|
|
else exit 1 |
| 122 |
|
|
fi |
| 123 |
|
|
echo "UTF8 test ran OK" |
| 124 |
|
|
echo " " |
| 125 |
|
|
fi |
| 126 |
|
|
|
| 127 |
nigel |
63 |
if [ $do5 = yes ] ; then |
| 128 |
|
|
echo "Testing API and internals for UTF-8 support (not Perl compatible)" |
| 129 |
|
|
./pcretest $testdata/testinput5 testtry |
| 130 |
nigel |
49 |
if [ $? = 0 ] ; then |
| 131 |
nigel |
63 |
$cf testtry $testdata/testoutput5 |
| 132 |
nigel |
49 |
if [ $? != 0 ] ; then exit 1; fi |
| 133 |
|
|
else exit 1 |
| 134 |
|
|
fi |
| 135 |
|
|
echo "UTF8 internals test ran OK" |
| 136 |
|
|
echo " " |
| 137 |
|
|
fi |
| 138 |
|
|
|
| 139 |
|
|
# End |