| 15 |
|
|
| 16 |
# When JIT support is available, all the tests are also run with -s+ to test |
# When JIT support is available, all the tests are also run with -s+ to test |
| 17 |
# (again, almost) everything with studying and the JIT option. There are also |
# (again, almost) everything with studying and the JIT option. There are also |
| 18 |
# two tests for JIT-specific features, one to be run when JIT support is |
# two tests for JIT-specific features, one to be run when JIT support is |
| 19 |
# available, and one when it is not. |
# available, and one when it is not. |
| 20 |
|
|
| 21 |
valgrind= |
valgrind= |
| 48 |
ucp=$? |
ucp=$? |
| 49 |
|
|
| 50 |
jitopt= |
jitopt= |
| 51 |
./pcretest -C | ./pcregrep 'No Just-in-time compiler support' >/dev/null |
./pcretest -C | ./pcregrep \ |
| 52 |
|
'No Just-in-time compiler support|this architecture is unsupported' \ |
| 53 |
|
>/dev/null |
| 54 |
jit=$? |
jit=$? |
| 55 |
if [ $jit -ne 0 ] ; then |
if [ $jit -ne 0 ] ; then |
| 56 |
jitopt=-s+ |
jitopt=-s+ |
| 57 |
fi |
else |
| 58 |
|
./pcretest -C | ./pcregrep 'this architecture is unsupported' >/dev/null |
| 59 |
|
jitnotcompiled=$? |
| 60 |
|
fi |
| 61 |
|
|
| 62 |
|
|
| 63 |
# Select which tests to run; for those that are explicitly requested, check |
# Select which tests to run; for those that are explicitly requested, check |
| 64 |
# that the necessary optional facilities are available. |
# that the necessary optional facilities are available. |
| 157 |
echo "Can't run test 15 because JIT support is configured" |
echo "Can't run test 15 because JIT support is configured" |
| 158 |
exit 1 |
exit 1 |
| 159 |
fi |
fi |
| 160 |
fi |
fi |
| 161 |
|
|
| 162 |
# If no specific tests were requested, select all. Those that are not |
# If no specific tests were requested, select all. Those that are not |
| 163 |
# relevant will be skipped. |
# relevant will be skipped. |
| 200 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 201 |
else exit 1 |
else exit 1 |
| 202 |
fi |
fi |
| 203 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 204 |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 205 |
else echo " OK" |
else echo " OK" |
| 206 |
fi |
fi |
| 207 |
done |
done |
| 208 |
fi |
fi |
| 225 |
echo " " |
echo " " |
| 226 |
exit 1 |
exit 1 |
| 227 |
fi |
fi |
| 228 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 229 |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 230 |
else echo " OK" |
else echo " OK" |
| 231 |
fi |
fi |
| 232 |
done |
done |
| 233 |
fi |
fi |
| 268 |
echo "settings rather than a bug in PCRE." |
echo "settings rather than a bug in PCRE." |
| 269 |
break; |
break; |
| 270 |
else |
else |
| 271 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 272 |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 273 |
else echo " OK" |
else echo " OK" |
| 274 |
fi |
fi |
| 275 |
fi |
fi |
| 276 |
else exit 1 |
else exit 1 |
| 290 |
echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)" |
echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)" |
| 291 |
if [ $utf8 -eq 0 ] ; then |
if [ $utf8 -eq 0 ] ; then |
| 292 |
echo " Skipped because UTF-8 support is not available" |
echo " Skipped because UTF-8 support is not available" |
| 293 |
else |
else |
| 294 |
for opt in "" "-s" $jitopt; do |
for opt in "" "-s" $jitopt; do |
| 295 |
$valgrind ./pcretest -q $opt $testdata/testinput4 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput4 testtry |
| 296 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 298 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 299 |
else exit 1 |
else exit 1 |
| 300 |
fi |
fi |
| 301 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 302 |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 303 |
else echo " OK" |
else echo " OK" |
| 304 |
fi |
fi |
| 305 |
done |
done |
| 306 |
fi |
fi |
| 307 |
fi |
fi |
| 308 |
|
|
| 309 |
if [ $do5 = yes ] ; then |
if [ $do5 = yes ] ; then |
| 310 |
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" |
| 311 |
if [ $utf8 -eq 0 ] ; then |
if [ $utf8 -eq 0 ] ; then |
| 312 |
echo " Skipped because UTF-8 support is not available" |
echo " Skipped because UTF-8 support is not available" |
| 313 |
else |
else |
| 314 |
for opt in "" "-s" $jitopt; do |
for opt in "" "-s" $jitopt; do |
| 315 |
$valgrind ./pcretest -q $opt $testdata/testinput5 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput5 testtry |
| 316 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 318 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 319 |
else exit 1 |
else exit 1 |
| 320 |
fi |
fi |
| 321 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 322 |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 323 |
else echo " OK" |
else echo " OK" |
| 324 |
fi |
fi |
| 325 |
done |
done |
| 326 |
fi |
fi |
| 327 |
fi |
fi |
| 328 |
|
|
| 329 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
| 330 |
echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)" |
echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)" |
| 331 |
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
| 332 |
echo " Skipped because Unicode property support is not available" |
echo " Skipped because Unicode property support is not available" |
| 333 |
else |
else |
| 334 |
for opt in "" "-s" $jitopt; do |
for opt in "" "-s" $jitopt; do |
| 335 |
$valgrind ./pcretest -q $opt $testdata/testinput6 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput6 testtry |
| 336 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 338 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 339 |
else exit 1 |
else exit 1 |
| 340 |
fi |
fi |
| 341 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 342 |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 343 |
else echo " OK" |
else echo " OK" |
| 344 |
fi |
fi |
| 345 |
done |
done |
| 346 |
fi |
fi |
| 347 |
fi |
fi |
| 348 |
|
|
| 349 |
# Tests for DFA matching support |
# Tests for DFA matching support |
| 365 |
echo "Test 8: DFA matching with UTF-8" |
echo "Test 8: DFA matching with UTF-8" |
| 366 |
if [ $utf8 -eq 0 ] ; then |
if [ $utf8 -eq 0 ] ; then |
| 367 |
echo " Skipped because UTF-8 support is not available" |
echo " Skipped because UTF-8 support is not available" |
| 368 |
else |
else |
| 369 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 370 |
$valgrind ./pcretest -q $opt -dfa $testdata/testinput8 testtry |
$valgrind ./pcretest -q $opt -dfa $testdata/testinput8 testtry |
| 371 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 375 |
fi |
fi |
| 376 |
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
| 377 |
done |
done |
| 378 |
fi |
fi |
| 379 |
fi |
fi |
| 380 |
|
|
| 381 |
if [ $do9 = yes ] ; then |
if [ $do9 = yes ] ; then |
| 382 |
echo "Test 9: DFA matching with Unicode properties" |
echo "Test 9: DFA matching with Unicode properties" |
| 383 |
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
| 384 |
echo " Skipped because Unicode property support is not available" |
echo " Skipped because Unicode property support is not available" |
| 385 |
else |
else |
| 386 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 387 |
$valgrind ./pcretest -q $opt -dfa $testdata/testinput9 testtry |
$valgrind ./pcretest -q $opt -dfa $testdata/testinput9 testtry |
| 388 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 392 |
fi |
fi |
| 393 |
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
| 394 |
done |
done |
| 395 |
fi |
fi |
| 396 |
fi |
fi |
| 397 |
|
|
| 398 |
# 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 |
| 403 |
|
|
| 404 |
if [ $do10 = yes ] ; then |
if [ $do10 = yes ] ; then |
| 405 |
echo "Test 10: Internal offsets and code size tests" |
echo "Test 10: Internal offsets and code size tests" |
| 406 |
if [ $link_size -ne 2 ] ; then |
if [ $link_size -ne 2 ] ; then |
| 407 |
echo " Skipped because link size is not 2" |
echo " Skipped because link size is not 2" |
| 408 |
elif [ $ucp -eq 0 ] ; then |
elif [ $ucp -eq 0 ] ; then |
| 409 |
echo " Skipped because Unicode property support is not available" |
echo " Skipped because Unicode property support is not available" |
| 410 |
else |
else |
| 411 |
for opt in "" "-s"; do |
for opt in "" "-s"; do |
| 412 |
$valgrind ./pcretest -q $opt $testdata/testinput10 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput10 testtry |
| 413 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 417 |
fi |
fi |
| 418 |
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
| 419 |
done |
done |
| 420 |
fi |
fi |
| 421 |
fi |
fi |
| 422 |
|
|
| 423 |
# Test of Perl >= 5.10 features without UTF8 support |
# Test of Perl >= 5.10 features without UTF8 support |
| 431 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 432 |
else exit 1 |
else exit 1 |
| 433 |
fi |
fi |
| 434 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 435 |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 436 |
else echo " OK" |
else echo " OK" |
| 437 |
fi |
fi |
| 438 |
done |
done |
| 439 |
fi |
fi |
| 444 |
echo "Test 12: Features from Perl >= 5.10 with UTF8 support" |
echo "Test 12: Features from Perl >= 5.10 with UTF8 support" |
| 445 |
if [ $utf8 -eq 0 ] ; then |
if [ $utf8 -eq 0 ] ; then |
| 446 |
echo " Skipped because UTF-8 support is not available" |
echo " Skipped because UTF-8 support is not available" |
| 447 |
else |
else |
| 448 |
for opt in "" "-s" $jitopt; do |
for opt in "" "-s" $jitopt; do |
| 449 |
$valgrind ./pcretest -q $opt $testdata/testinput12 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput12 testtry |
| 450 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 452 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 453 |
else exit 1 |
else exit 1 |
| 454 |
fi |
fi |
| 455 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 456 |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 457 |
else echo " OK" |
else echo " OK" |
| 458 |
fi |
fi |
| 459 |
done |
done |
| 460 |
fi |
fi |
| 461 |
fi |
fi |
| 462 |
|
|
| 463 |
# Test non-Perl-compatible Unicode property support |
# Test non-Perl-compatible Unicode property support |
| 466 |
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" |
| 467 |
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
| 468 |
echo " Skipped because Unicode property support is not available" |
echo " Skipped because Unicode property support is not available" |
| 469 |
else |
else |
| 470 |
for opt in "" "-s" $jitopt; do |
for opt in "" "-s" $jitopt; do |
| 471 |
$valgrind ./pcretest -q $opt $testdata/testinput13 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput13 testtry |
| 472 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 474 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 475 |
else exit 1 |
else exit 1 |
| 476 |
fi |
fi |
| 477 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 478 |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 479 |
else echo " OK" |
else echo " OK" |
| 480 |
fi |
fi |
| 481 |
done |
done |
| 482 |
fi |
fi |
| 483 |
fi |
fi |
| 484 |
|
|
| 485 |
# Test JIT-specific features when JIT is available |
# Test JIT-specific features when JIT is available |
| 486 |
|
|
| 487 |
if [ $do14 = yes ] ; then |
if [ $do14 = yes ] ; then |
| 488 |
echo "Test 14: JIT-specific features (JIT available)" |
echo "Test 14: JIT-specific features (JIT available and usable)" |
| 489 |
if [ $jit -eq 0 ] ; then |
if [ $jit -eq 0 ] ; then |
| 490 |
echo " Skipped because JIT is not available" |
echo " Skipped because JIT is not available or not usable" |
| 491 |
else |
else |
| 492 |
$valgrind ./pcretest -q $testdata/testinput14 testtry |
$valgrind ./pcretest -q $testdata/testinput14 testtry |
| 493 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 495 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 496 |
else exit 1 |
else exit 1 |
| 497 |
fi |
fi |
| 498 |
echo " OK" |
echo " OK" |
| 499 |
fi |
fi |
| 500 |
fi |
fi |
| 501 |
|
|
| 502 |
# Test JIT-specific features when JIT is not available |
# Test JIT-specific features when JIT is not available |
| 503 |
|
|
| 504 |
if [ $do15 = yes ] ; then |
if [ $do15 = yes ] ; then |
| 505 |
echo "Test 15: JIT-specific features (JIT not available)" |
echo "Test 15: JIT-specific features (JIT not available or not usable)" |
| 506 |
if [ $jit -ne 0 ] ; then |
if [ $jit -ne 0 ] ; then |
| 507 |
echo " Skipped because JIT is available" |
echo " Skipped because JIT is available" |
| 508 |
|
elif [ $jitnotcompiled -eq 0 ] ; then |
| 509 |
|
echo " Skipped because JIT does not support this architecture" |
| 510 |
else |
else |
| 511 |
$valgrind ./pcretest -q $testdata/testinput15 testtry |
$valgrind ./pcretest -q $testdata/testinput15 testtry |
| 512 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 514 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 515 |
else exit 1 |
else exit 1 |
| 516 |
fi |
fi |
| 517 |
echo " OK" |
echo " OK" |
| 518 |
fi |
fi |
| 519 |
fi |
fi |
| 520 |
|
|
| 521 |
# End |
# End |