| 152 |
|
|
| 153 |
if [ $do1 = yes ] ; then |
if [ $do1 = yes ] ; then |
| 154 |
echo "Test 1: main functionality (Compatible with Perl >= 5.8)" |
echo "Test 1: main functionality (Compatible with Perl >= 5.8)" |
| 155 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 156 |
$valgrind ./pcretest -q $opt $testdata/testinput1 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput1 testtry |
| 157 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 158 |
$cf $testdata/testoutput1 testtry |
$cf $testdata/testoutput1 testtry |
| 160 |
else exit 1 |
else exit 1 |
| 161 |
fi |
fi |
| 162 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 163 |
done |
done |
| 164 |
fi |
fi |
| 165 |
|
|
| 166 |
# PCRE tests that are not Perl-compatible - API, errors, internals |
# PCRE tests that are not Perl-compatible - API, errors, internals |
| 167 |
|
|
| 168 |
if [ $do2 = yes ] ; then |
if [ $do2 = yes ] ; then |
| 169 |
echo "Test 2: API, errors, internals, and non-Perl stuff" |
echo "Test 2: API, errors, internals, and non-Perl stuff" |
| 170 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 171 |
$valgrind ./pcretest -q $opt $testdata/testinput2 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput2 testtry |
| 172 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 173 |
$cf $testdata/testoutput2 testtry |
$cf $testdata/testoutput2 testtry |
| 182 |
exit 1 |
exit 1 |
| 183 |
fi |
fi |
| 184 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 185 |
done |
done |
| 186 |
fi |
fi |
| 187 |
|
|
| 188 |
# Locale-specific tests, provided that either the "fr_FR" or the "french" |
# Locale-specific tests, provided that either the "fr_FR" or the "french" |
| 210 |
|
|
| 211 |
if [ "$locale" != "" ] ; then |
if [ "$locale" != "" ] ; then |
| 212 |
echo "Test 3: locale-specific features (using '$locale' locale)" |
echo "Test 3: locale-specific features (using '$locale' locale)" |
| 213 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 214 |
$valgrind ./pcretest -q $opt $infile testtry |
$valgrind ./pcretest -q $opt $infile testtry |
| 215 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 216 |
$cf $outfile testtry |
$cf $outfile testtry |
| 219 |
echo "Locale test did not run entirely successfully." |
echo "Locale test did not run entirely successfully." |
| 220 |
echo "This usually means that there is a problem with the locale" |
echo "This usually means that there is a problem with the locale" |
| 221 |
echo "settings rather than a bug in PCRE." |
echo "settings rather than a bug in PCRE." |
| 222 |
break; |
break; |
| 223 |
else |
else |
| 224 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 225 |
fi |
fi |
| 226 |
else exit 1 |
else exit 1 |
| 227 |
fi |
fi |
| 228 |
done |
done |
| 229 |
else |
else |
| 230 |
echo "Cannot test locale-specific features - neither the 'fr_FR' nor the" |
echo "Cannot test locale-specific features - neither the 'fr_FR' nor the" |
| 231 |
echo "'french' locale exists, or the \"locale\" command is not available" |
echo "'french' locale exists, or the \"locale\" command is not available" |
| 238 |
|
|
| 239 |
if [ $do4 = yes ] ; then |
if [ $do4 = yes ] ; then |
| 240 |
echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)" |
echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)" |
| 241 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 242 |
$valgrind ./pcretest -q $opt $testdata/testinput4 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput4 testtry |
| 243 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 244 |
$cf $testdata/testoutput4 testtry |
$cf $testdata/testoutput4 testtry |
| 246 |
else exit 1 |
else exit 1 |
| 247 |
fi |
fi |
| 248 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 249 |
done |
done |
| 250 |
fi |
fi |
| 251 |
|
|
| 252 |
if [ $do5 = yes ] ; then |
if [ $do5 = yes ] ; then |
| 253 |
echo "Test 5: API, internals, and non-Perl stuff for UTF-8 support" |
echo "Test 5: API, internals, and non-Perl stuff for UTF-8 support" |
| 254 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 255 |
$valgrind ./pcretest -q $opt $testdata/testinput5 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput5 testtry |
| 256 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 257 |
$cf $testdata/testoutput5 testtry |
$cf $testdata/testoutput5 testtry |
| 259 |
else exit 1 |
else exit 1 |
| 260 |
fi |
fi |
| 261 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 262 |
done |
done |
| 263 |
fi |
fi |
| 264 |
|
|
| 265 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
| 266 |
echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)" |
echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)" |
| 267 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 268 |
$valgrind ./pcretest -q $opt $testdata/testinput6 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput6 testtry |
| 269 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 270 |
$cf $testdata/testoutput6 testtry |
$cf $testdata/testoutput6 testtry |
| 272 |
else exit 1 |
else exit 1 |
| 273 |
fi |
fi |
| 274 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 275 |
done |
done |
| 276 |
fi |
fi |
| 277 |
|
|
| 278 |
# Tests for DFA matching support |
# Tests for DFA matching support |
| 279 |
|
|
| 280 |
if [ $do7 = yes ] ; then |
if [ $do7 = yes ] ; then |
| 281 |
echo "Test 7: DFA matching" |
echo "Test 7: DFA matching" |
| 282 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 283 |
$valgrind ./pcretest -q $opt -dfa $testdata/testinput7 testtry |
$valgrind ./pcretest -q $opt -dfa $testdata/testinput7 testtry |
| 284 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 285 |
$cf $testdata/testoutput7 testtry |
$cf $testdata/testoutput7 testtry |
| 287 |
else exit 1 |
else exit 1 |
| 288 |
fi |
fi |
| 289 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 290 |
done |
done |
| 291 |
fi |
fi |
| 292 |
|
|
| 293 |
if [ $do8 = yes ] ; then |
if [ $do8 = yes ] ; then |
| 294 |
echo "Test 8: DFA matching with UTF-8" |
echo "Test 8: DFA matching with UTF-8" |
| 295 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 296 |
$valgrind ./pcretest -q $opt -dfa $testdata/testinput8 testtry |
$valgrind ./pcretest -q $opt -dfa $testdata/testinput8 testtry |
| 297 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 298 |
$cf $testdata/testoutput8 testtry |
$cf $testdata/testoutput8 testtry |
| 300 |
else exit 1 |
else exit 1 |
| 301 |
fi |
fi |
| 302 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 303 |
done |
done |
| 304 |
fi |
fi |
| 305 |
|
|
| 306 |
if [ $do9 = yes ] ; then |
if [ $do9 = yes ] ; then |
| 307 |
echo "Test 9: DFA matching with Unicode properties" |
echo "Test 9: DFA matching with Unicode properties" |
| 308 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 309 |
$valgrind ./pcretest -q $opt -dfa $testdata/testinput9 testtry |
$valgrind ./pcretest -q $opt -dfa $testdata/testinput9 testtry |
| 310 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 311 |
$cf $testdata/testoutput9 testtry |
$cf $testdata/testoutput9 testtry |
| 313 |
else exit 1 |
else exit 1 |
| 314 |
fi |
fi |
| 315 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 316 |
done |
done |
| 317 |
fi |
fi |
| 318 |
|
|
| 319 |
# Test of internal offsets and code sizes. This test is run only when there |
# Test of internal offsets and code sizes. This test is run only when there |
| 324 |
|
|
| 325 |
if [ $do10 = yes ] ; then |
if [ $do10 = yes ] ; then |
| 326 |
echo "Test 10: Internal offsets and code size tests" |
echo "Test 10: Internal offsets and code size tests" |
| 327 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 328 |
$valgrind ./pcretest -q $opt $testdata/testinput10 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput10 testtry |
| 329 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 330 |
$cf $testdata/testoutput10 testtry |
$cf $testdata/testoutput10 testtry |
| 332 |
else exit 1 |
else exit 1 |
| 333 |
fi |
fi |
| 334 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 335 |
done |
done |
| 336 |
fi |
fi |
| 337 |
|
|
| 338 |
# Test of Perl >= 5.10 features without UTF8 support |
# Test of Perl >= 5.10 features without UTF8 support |
| 339 |
|
|
| 340 |
if [ $do11 = yes ] ; then |
if [ $do11 = yes ] ; then |
| 341 |
echo "Test 11: Features from Perl >= 5.10 without UTF8 support" |
echo "Test 11: Features from Perl >= 5.10 without UTF8 support" |
| 342 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 343 |
$valgrind ./pcretest -q $opt $testdata/testinput11 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput11 testtry |
| 344 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 345 |
$cf $testdata/testoutput11 testtry |
$cf $testdata/testoutput11 testtry |
| 347 |
else exit 1 |
else exit 1 |
| 348 |
fi |
fi |
| 349 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 350 |
done |
done |
| 351 |
fi |
fi |
| 352 |
|
|
| 353 |
# Test of Perl >= 5.10 features with UTF8 support |
# Test of Perl >= 5.10 features with UTF8 support |
| 354 |
|
|
| 355 |
if [ $do12 = yes ] ; then |
if [ $do12 = yes ] ; then |
| 356 |
echo "Test 12: Features from Perl >= 5.10 with UTF8 support" |
echo "Test 12: Features from Perl >= 5.10 with UTF8 support" |
| 357 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 358 |
$valgrind ./pcretest -q $opt $testdata/testinput12 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput12 testtry |
| 359 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 360 |
$cf $testdata/testoutput12 testtry |
$cf $testdata/testoutput12 testtry |
| 362 |
else exit 1 |
else exit 1 |
| 363 |
fi |
fi |
| 364 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 365 |
done |
done |
| 366 |
fi |
fi |
| 367 |
|
|
| 368 |
# Test non-Perl-compatible Unicode property support |
# Test non-Perl-compatible Unicode property support |
| 369 |
|
|
| 370 |
if [ $do13 = yes ] ; then |
if [ $do13 = yes ] ; then |
| 371 |
echo "Test 13: API, internals, and non-Perl stuff for Unicode property support" |
echo "Test 13: API, internals, and non-Perl stuff for Unicode property support" |
| 372 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 373 |
$valgrind ./pcretest -q $opt $testdata/testinput13 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput13 testtry |
| 374 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 375 |
$cf $testdata/testoutput13 testtry |
$cf $testdata/testoutput13 testtry |
| 377 |
else exit 1 |
else exit 1 |
| 378 |
fi |
fi |
| 379 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
| 380 |
done |
done |
| 381 |
fi |
fi |
| 382 |
|
|
| 383 |
# End |
# End |