| 30 |
shift |
shift |
| 31 |
done |
done |
| 32 |
|
|
| 33 |
|
if [ "@LINK_SIZE@" != "" -a "@LINK_SIZE@" != "-DLINK_SIZE=2" ] ; then |
| 34 |
|
if [ $do2 = yes ] ; then |
| 35 |
|
echo "Can't run test 2 with an internal link size other than 2" |
| 36 |
|
exit 1 |
| 37 |
|
fi |
| 38 |
|
if [ $do5 = yes ] ; then |
| 39 |
|
echo "Can't run test 5 with an internal link size other than 2" |
| 40 |
|
exit 1 |
| 41 |
|
fi |
| 42 |
|
if [ $do6 = yes ] ; then |
| 43 |
|
echo "Can't run test 6 with an internal link size other than 2" |
| 44 |
|
exit 1 |
| 45 |
|
fi |
| 46 |
|
fi |
| 47 |
|
|
| 48 |
if [ "@UTF8@" = "" ] ; then |
if [ "@UTF8@" = "" ] ; then |
| 49 |
|
if [ $do4 = yes ] ; then |
| 50 |
|
echo "Can't run test 4 because UTF-8 support is not configured" |
| 51 |
|
exit 1 |
| 52 |
|
fi |
| 53 |
if [ $do5 = yes ] ; then |
if [ $do5 = yes ] ; then |
| 54 |
echo "Can't run test 5 because UFT8 support is not configured" |
echo "Can't run test 5 because UTF-8 support is not configured" |
| 55 |
exit 1 |
exit 1 |
| 56 |
fi |
fi |
| 57 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
| 58 |
echo "Can't run test 6 because UFT8 support is not configured" |
echo "Can't run test 6 because UTF-8 support is not configured" |
| 59 |
exit 1 |
exit 1 |
| 60 |
fi |
fi |
| 61 |
fi |
fi |
| 62 |
|
|
| 63 |
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a\ |
if [ "@UCP@" = "" ] ; then |
| 64 |
|
if [ $do6 = yes ] ; then |
| 65 |
|
echo "Can't run test 6 because Unicode property support is not configured" |
| 66 |
|
exit 1 |
| 67 |
|
fi |
| 68 |
|
fi |
| 69 |
|
|
| 70 |
|
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ |
| 71 |
$do5 = no -a $do6 = no ] ; then |
$do5 = no -a $do6 = no ] ; then |
| 72 |
do1=yes |
do1=yes |
| 73 |
do2=yes |
do2=yes |
| 74 |
do3=yes |
do3=yes |
| 75 |
do4=yes |
if [ "@UTF8@" != "" ] ; then do4=yes; fi |
| 76 |
if [ "@UTF8@" != "" ] ; then do5=yes; fi |
if [ "@UTF8@" != "" ] ; then do5=yes; fi |
| 77 |
if [ "@UTF8@" != "" ] ; then do6=yes; fi |
if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do6=yes; fi |
| 78 |
fi |
fi |
| 79 |
|
|
| 80 |
|
# Show which release |
| 81 |
|
|
| 82 |
|
./pcretest /dev/null |
| 83 |
|
|
| 84 |
# Primary test, Perl-compatible |
# Primary test, Perl-compatible |
| 85 |
|
|
| 86 |
if [ $do1 = yes ] ; then |
if [ $do1 = yes ] ; then |
| 87 |
echo "Testing main functionality (Perl compatible)" |
echo "Test 1: main functionality (Perl compatible)" |
| 88 |
./pcretest $testdata/testinput1 testtry |
./pcretest $testdata/testinput1 testtry |
| 89 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 90 |
$cf testtry $testdata/testoutput1 |
$cf testtry $testdata/testoutput1 |
| 91 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 92 |
|
echo " " |
| 93 |
else exit 1 |
else exit 1 |
| 94 |
fi |
fi |
| 95 |
fi |
fi |
| 97 |
# PCRE tests that are not Perl-compatible - API & error tests, mostly |
# PCRE tests that are not Perl-compatible - API & error tests, mostly |
| 98 |
|
|
| 99 |
if [ $do2 = yes ] ; then |
if [ $do2 = yes ] ; then |
| 100 |
echo "Testing API and error handling (not Perl compatible)" |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
| 101 |
./pcretest -i $testdata/testinput2 testtry |
echo "Test 2: API and error handling (not Perl compatible)" |
| 102 |
if [ $? = 0 ] ; then |
./pcretest -i $testdata/testinput2 testtry |
| 103 |
$cf testtry $testdata/testoutput2 |
if [ $? = 0 ] ; then |
| 104 |
if [ $? != 0 ] ; then exit 1; fi |
$cf testtry $testdata/testoutput2 |
| 105 |
else exit 1 |
if [ $? != 0 ] ; then exit 1; fi |
| 106 |
fi |
else exit 1 |
| 107 |
fi |
fi |
| 108 |
|
else |
| 109 |
# Additional Perl-compatible tests for Perl 5.005's new features |
echo Test 2 skipped for link size other than 2 \(@LINK_SIZE@\) |
| 110 |
|
fi |
|
if [ $do3 = yes ] ; then |
|
|
echo "Testing Perl 5.005 features (Perl 5.005 compatible)" |
|
|
./pcretest $testdata/testinput3 testtry |
|
|
if [ $? = 0 ] ; then |
|
|
$cf testtry $testdata/testoutput3 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
|
|
else exit 1 |
|
|
fi |
|
| 111 |
fi |
fi |
| 112 |
|
|
| 113 |
if [ $do1 = yes -a $do2 = yes -a $do3 = yes ] ; then |
if [ $do1 = yes -a $do2 = yes ] ; then |
| 114 |
echo " " |
echo " " |
| 115 |
echo "The three main tests all ran OK" |
echo "The two main tests ran OK" |
| 116 |
echo " " |
echo " " |
| 117 |
fi |
fi |
| 118 |
|
|
| 119 |
# Locale-specific tests, provided the "fr" locale is available |
# Locale-specific tests, provided the "fr_FR" locale is available |
| 120 |
|
|
| 121 |
if [ $do4 = yes ] ; then |
if [ $do3 = yes ] ; then |
| 122 |
locale -a | grep '^fr$' >/dev/null |
locale -a | grep '^fr_FR$' >/dev/null |
| 123 |
if [ $? -eq 0 ] ; then |
if [ $? -eq 0 ] ; then |
| 124 |
echo "Testing locale-specific features (using 'fr' locale)" |
echo "Test 3: locale-specific features (using 'fr_FR' locale)" |
| 125 |
./pcretest $testdata/testinput4 testtry |
./pcretest $testdata/testinput3 testtry |
| 126 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 127 |
$cf testtry $testdata/testoutput4 |
$cf testtry $testdata/testoutput3 |
| 128 |
if [ $? != 0 ] ; then |
if [ $? != 0 ] ; then |
| 129 |
echo " " |
echo " " |
| 130 |
echo "Locale test did not run entirely successfully." |
echo "Locale test did not run entirely successfully." |
| 137 |
else exit 1 |
else exit 1 |
| 138 |
fi |
fi |
| 139 |
else |
else |
| 140 |
echo "Cannot test locale-specific features - 'fr' locale not found," |
echo "Cannot test locale-specific features - 'fr_FR' locale not found," |
| 141 |
echo "or the \"locale\" command is not available to check for it." |
echo "or the \"locale\" command is not available to check for it." |
| 142 |
echo " " |
echo " " |
| 143 |
fi |
fi |
| 145 |
|
|
| 146 |
# Additional tests for UTF8 support |
# Additional tests for UTF8 support |
| 147 |
|
|
| 148 |
if [ $do5 = yes ] ; then |
if [ $do4 = yes ] ; then |
| 149 |
echo "Testing experimental, incomplete UTF8 support (Perl compatible)" |
echo "Test 4: UTF-8 support (Perl compatible)" |
| 150 |
./pcretest $testdata/testinput5 testtry |
./pcretest $testdata/testinput4 testtry |
| 151 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 152 |
$cf testtry $testdata/testoutput5 |
$cf testtry $testdata/testoutput4 |
| 153 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 154 |
else exit 1 |
else exit 1 |
| 155 |
fi |
fi |
| 157 |
echo " " |
echo " " |
| 158 |
fi |
fi |
| 159 |
|
|
| 160 |
|
if [ $do5 = yes ] ; then |
| 161 |
|
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
| 162 |
|
echo "Test 5: API and internals for UTF-8 support (not Perl compatible)" |
| 163 |
|
./pcretest $testdata/testinput5 testtry |
| 164 |
|
if [ $? = 0 ] ; then |
| 165 |
|
$cf testtry $testdata/testoutput5 |
| 166 |
|
if [ $? != 0 ] ; then exit 1; fi |
| 167 |
|
else exit 1 |
| 168 |
|
fi |
| 169 |
|
echo "UTF8 internals test ran OK" |
| 170 |
|
echo " " |
| 171 |
|
else |
| 172 |
|
echo Test 5 skipped for link size other than 2 \(@LINK_SIZE@\) |
| 173 |
|
fi |
| 174 |
|
fi |
| 175 |
|
|
| 176 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
| 177 |
echo "Testing API and internals for UTF8 support (not Perl compatible)" |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
| 178 |
./pcretest $testdata/testinput6 testtry |
echo "Test 6: Unicode property support" |
| 179 |
if [ $? = 0 ] ; then |
./pcretest $testdata/testinput6 testtry |
| 180 |
$cf testtry $testdata/testoutput6 |
if [ $? = 0 ] ; then |
| 181 |
if [ $? != 0 ] ; then exit 1; fi |
$cf testtry $testdata/testoutput6 |
| 182 |
else exit 1 |
if [ $? != 0 ] ; then exit 1; fi |
| 183 |
fi |
else exit 1 |
| 184 |
echo "UTF8 internals test ran OK" |
fi |
| 185 |
echo " " |
echo "Unicode properties test ran OK" |
| 186 |
|
echo " " |
| 187 |
|
else |
| 188 |
|
echo Test 6 skipped for link size other than 2 \(@LINK_SIZE@\) |
| 189 |
|
fi |
| 190 |
fi |
fi |
| 191 |
|
|
| 192 |
# End |
# End |