| 16 |
do4=no |
do4=no |
| 17 |
do5=no |
do5=no |
| 18 |
do6=no |
do6=no |
| 19 |
|
do7=no |
| 20 |
|
do8=no |
| 21 |
|
do9=no |
| 22 |
|
|
| 23 |
while [ $# -gt 0 ] ; do |
while [ $# -gt 0 ] ; do |
| 24 |
case $1 in |
case $1 in |
| 26 |
2) do2=yes;; |
2) do2=yes;; |
| 27 |
3) do3=yes;; |
3) do3=yes;; |
| 28 |
4) do4=yes;; |
4) do4=yes;; |
| 29 |
5) do5=yes;; |
5) do5=yes;; |
| 30 |
6) do6=yes;; |
6) do6=yes;; |
| 31 |
|
7) do7=yes;; |
| 32 |
|
8) do8=yes;; |
| 33 |
|
9) do9=yes;; |
| 34 |
*) echo "Unknown test number $1"; exit 1;; |
*) echo "Unknown test number $1"; exit 1;; |
| 35 |
esac |
esac |
| 36 |
shift |
shift |
| 39 |
if [ "@LINK_SIZE@" != "" -a "@LINK_SIZE@" != "-DLINK_SIZE=2" ] ; then |
if [ "@LINK_SIZE@" != "" -a "@LINK_SIZE@" != "-DLINK_SIZE=2" ] ; then |
| 40 |
if [ $do2 = yes ] ; then |
if [ $do2 = yes ] ; then |
| 41 |
echo "Can't run test 2 with an internal link size other than 2" |
echo "Can't run test 2 with an internal link size other than 2" |
| 42 |
exit 1 |
exit 1 |
| 43 |
fi |
fi |
| 44 |
if [ $do5 = yes ] ; then |
if [ $do5 = yes ] ; then |
| 45 |
echo "Can't run test 5 with an internal link size other than 2" |
echo "Can't run test 5 with an internal link size other than 2" |
| 46 |
exit 1 |
exit 1 |
| 47 |
fi |
fi |
| 48 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
| 49 |
echo "Can't run test 6 with an internal link size other than 2" |
echo "Can't run test 6 with an internal link size other than 2" |
| 50 |
exit 1 |
exit 1 |
| 51 |
fi |
fi |
| 52 |
fi |
fi |
| 53 |
|
|
| 54 |
if [ "@UTF8@" = "" ] ; then |
if [ "@UTF8@" = "" ] ; then |
| 55 |
if [ $do4 = yes ] ; then |
if [ $do4 = yes ] ; then |
| 56 |
echo "Can't run test 4 because UTF-8 support is not configured" |
echo "Can't run test 4 because UTF-8 support is not configured" |
| 57 |
exit 1 |
exit 1 |
| 58 |
fi |
fi |
| 59 |
if [ $do5 = yes ] ; then |
if [ $do5 = yes ] ; then |
| 60 |
echo "Can't run test 5 because UTF-8 support is not configured" |
echo "Can't run test 5 because UTF-8 support is not configured" |
| 61 |
exit 1 |
exit 1 |
| 62 |
fi |
fi |
| 63 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
| 64 |
echo "Can't run test 6 because UTF-8 support is not configured" |
echo "Can't run test 6 because UTF-8 support is not configured" |
| 65 |
exit 1 |
exit 1 |
| 66 |
fi |
fi |
| 67 |
fi |
if [ $do8 = yes ] ; then |
| 68 |
|
echo "Can't run test 8 because UTF-8 support is not configured" |
| 69 |
|
exit 1 |
| 70 |
|
fi |
| 71 |
|
if [ $do9 = yes ] ; then |
| 72 |
|
echo "Can't run test 9 because UTF-8 support is not configured" |
| 73 |
|
exit 1 |
| 74 |
|
fi |
| 75 |
|
fi |
| 76 |
|
|
| 77 |
if [ "@UCP@" = "" ] ; then |
if [ "@UCP@" = "" ] ; then |
| 78 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
| 79 |
echo "Can't run test 6 because Unicode property support is not configured" |
echo "Can't run test 6 because Unicode property support is not configured" |
| 80 |
exit 1 |
exit 1 |
| 81 |
fi |
fi |
| 82 |
fi |
if [ $do9 = yes ] ; then |
| 83 |
|
echo "Can't run test 9 because Unicode property support is not configured" |
| 84 |
|
exit 1 |
| 85 |
|
fi |
| 86 |
|
fi |
| 87 |
|
|
| 88 |
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ |
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ |
| 89 |
$do5 = no -a $do6 = no ] ; then |
$do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \ |
| 90 |
|
$do9 = no ] ; then |
| 91 |
do1=yes |
do1=yes |
| 92 |
do2=yes |
do2=yes |
| 93 |
do3=yes |
do3=yes |
| 94 |
if [ "@UTF8@" != "" ] ; then do4=yes; fi |
if [ "@UTF8@" != "" ] ; then do4=yes; fi |
| 95 |
if [ "@UTF8@" != "" ] ; then do5=yes; fi |
if [ "@UTF8@" != "" ] ; then do5=yes; fi |
| 96 |
if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do6=yes; fi |
if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do6=yes; fi |
| 97 |
|
do7=yes |
| 98 |
|
if [ "@UTF8@" != "" ] ; then do8=yes; fi |
| 99 |
|
if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do9=yes; fi |
| 100 |
fi |
fi |
| 101 |
|
|
| 102 |
# Show which release |
# Show which release |
| 111 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 112 |
$cf testtry $testdata/testoutput1 |
$cf testtry $testdata/testoutput1 |
| 113 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
|
echo " " |
|
| 114 |
else exit 1 |
else exit 1 |
| 115 |
fi |
fi |
| 116 |
|
echo "OK" |
| 117 |
|
echo " " |
| 118 |
fi |
fi |
| 119 |
|
|
| 120 |
# PCRE tests that are not Perl-compatible - API & error tests, mostly |
# PCRE tests that are not Perl-compatible - API & error tests, mostly |
| 121 |
|
|
| 122 |
if [ $do2 = yes ] ; then |
if [ $do2 = yes ] ; then |
| 123 |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
| 124 |
echo "Test 2: API and error handling (not Perl compatible)" |
echo "Test 2: API and error handling (not Perl compatible)" |
| 125 |
./pcretest -i $testdata/testinput2 testtry |
./pcretest -i $testdata/testinput2 testtry |
| 126 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 128 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 129 |
else exit 1 |
else exit 1 |
| 130 |
fi |
fi |
| 131 |
|
echo "OK" |
| 132 |
|
echo " " |
| 133 |
else |
else |
| 134 |
echo Test 2 skipped for link size other than 2 \(@LINK_SIZE@\) |
echo Test 2 skipped for link size other than 2 \(@LINK_SIZE@\) |
| 135 |
fi |
echo " " |
| 136 |
fi |
fi |
|
|
|
|
if [ $do1 = yes -a $do2 = yes ] ; then |
|
|
echo " " |
|
|
echo "The two main tests ran OK" |
|
|
echo " " |
|
| 137 |
fi |
fi |
| 138 |
|
|
| 139 |
# Locale-specific tests, provided the "fr_FR" locale is available |
# Locale-specific tests, provided the "fr_FR" locale is available |
| 145 |
./pcretest $testdata/testinput3 testtry |
./pcretest $testdata/testinput3 testtry |
| 146 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 147 |
$cf testtry $testdata/testoutput3 |
$cf testtry $testdata/testoutput3 |
| 148 |
if [ $? != 0 ] ; then |
if [ $? != 0 ] ; then |
| 149 |
echo " " |
echo " " |
| 150 |
echo "Locale test did not run entirely successfully." |
echo "Locale test did not run entirely successfully." |
| 151 |
echo "This usually means that there is a problem with the locale" |
echo "This usually means that there is a problem with the locale" |
| 152 |
echo "settings rather than a bug in PCRE." |
echo "settings rather than a bug in PCRE." |
| 153 |
else |
else |
| 154 |
echo "Locale test ran OK" |
echo "OK" |
| 155 |
fi |
fi |
| 156 |
echo " " |
echo " " |
| 157 |
else exit 1 |
else exit 1 |
| 158 |
fi |
fi |
| 159 |
else |
else |
| 160 |
echo "Cannot test locale-specific features - 'fr_FR' locale not found," |
echo "Cannot test locale-specific features - 'fr_FR' locale not found," |
| 161 |
echo "or the \"locale\" command is not available to check for it." |
echo "or the \"locale\" command is not available to check for it." |
| 162 |
echo " " |
echo " " |
| 163 |
fi |
fi |
| 164 |
fi |
fi |
| 165 |
|
|
| 167 |
|
|
| 168 |
if [ $do4 = yes ] ; then |
if [ $do4 = yes ] ; then |
| 169 |
echo "Test 4: UTF-8 support (Perl compatible)" |
echo "Test 4: UTF-8 support (Perl compatible)" |
| 170 |
./pcretest $testdata/testinput4 testtry |
./pcretest $testdata/testinput4 testtry |
| 171 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 172 |
$cf testtry $testdata/testoutput4 |
$cf testtry $testdata/testoutput4 |
| 173 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 174 |
else exit 1 |
else exit 1 |
| 175 |
fi |
fi |
| 176 |
echo "UTF8 test ran OK" |
echo "OK" |
| 177 |
echo " " |
echo " " |
| 178 |
fi |
fi |
| 179 |
|
|
| 180 |
if [ $do5 = yes ] ; then |
if [ $do5 = yes ] ; then |
| 181 |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
| 182 |
echo "Test 5: API and internals for UTF-8 support (not Perl compatible)" |
echo "Test 5: API and internals for UTF-8 support (not Perl compatible)" |
| 183 |
./pcretest $testdata/testinput5 testtry |
./pcretest $testdata/testinput5 testtry |
| 184 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 185 |
$cf testtry $testdata/testoutput5 |
$cf testtry $testdata/testoutput5 |
| 186 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 187 |
else exit 1 |
else exit 1 |
| 188 |
fi |
fi |
| 189 |
echo "UTF8 internals test ran OK" |
echo "OK" |
| 190 |
echo " " |
echo " " |
| 191 |
else |
else |
| 192 |
echo Test 5 skipped for link size other than 2 \(@LINK_SIZE@\) |
echo Test 5 skipped for link size other than 2 \(@LINK_SIZE@\) |
| 193 |
fi |
echo " " |
| 194 |
|
fi |
| 195 |
fi |
fi |
| 196 |
|
|
| 197 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
| 198 |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
| 199 |
echo "Test 6: Unicode property support" |
echo "Test 6: Unicode property support" |
| 200 |
./pcretest $testdata/testinput6 testtry |
./pcretest $testdata/testinput6 testtry |
| 201 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 202 |
$cf testtry $testdata/testoutput6 |
$cf testtry $testdata/testoutput6 |
| 203 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 204 |
else exit 1 |
else exit 1 |
| 205 |
fi |
fi |
| 206 |
echo "Unicode properties test ran OK" |
echo "OK" |
| 207 |
echo " " |
echo " " |
| 208 |
else |
else |
| 209 |
echo Test 6 skipped for link size other than 2 \(@LINK_SIZE@\) |
echo Test 6 skipped for link size other than 2 \(@LINK_SIZE@\) |
| 210 |
fi |
echo " " |
| 211 |
|
fi |
| 212 |
|
fi |
| 213 |
|
|
| 214 |
|
# Tests for DFA matching support |
| 215 |
|
|
| 216 |
|
if [ $do7 = yes ] ; then |
| 217 |
|
echo "Test 7: DFA matching" |
| 218 |
|
./pcretest -dfa $testdata/testinput7 testtry |
| 219 |
|
if [ $? = 0 ] ; then |
| 220 |
|
$cf testtry $testdata/testoutput7 |
| 221 |
|
if [ $? != 0 ] ; then exit 1; fi |
| 222 |
|
else exit 1 |
| 223 |
|
fi |
| 224 |
|
echo "OK" |
| 225 |
|
echo " " |
| 226 |
|
fi |
| 227 |
|
|
| 228 |
|
if [ $do8 = yes ] ; then |
| 229 |
|
echo "Test 8: DFA matching with UTF-8" |
| 230 |
|
./pcretest -dfa $testdata/testinput8 testtry |
| 231 |
|
if [ $? = 0 ] ; then |
| 232 |
|
$cf testtry $testdata/testoutput8 |
| 233 |
|
if [ $? != 0 ] ; then exit 1; fi |
| 234 |
|
else exit 1 |
| 235 |
|
fi |
| 236 |
|
echo "OK" |
| 237 |
|
echo " " |
| 238 |
|
fi |
| 239 |
|
|
| 240 |
|
if [ $do9 = yes ] ; then |
| 241 |
|
echo "Test 9: DFA matching with Unicode properties" |
| 242 |
|
./pcretest -dfa $testdata/testinput9 testtry |
| 243 |
|
if [ $? = 0 ] ; then |
| 244 |
|
$cf testtry $testdata/testoutput9 |
| 245 |
|
if [ $? != 0 ] ; then exit 1; fi |
| 246 |
|
else exit 1 |
| 247 |
|
fi |
| 248 |
|
echo "OK" |
| 249 |
|
echo " " |
| 250 |
fi |
fi |
| 251 |
|
|
| 252 |
# End |
# End |