7 # Select which tests to run; if no selection, run all
14 while [ $# -gt 0 ] ; do
20 *) echo "Unknown test number $1"; exit 1;;
25 if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no ] ; then
32 # Primary test, Perl-compatible
34 if [ $do1 = yes ] ; then
35 echo "Testing main functionality (Perl compatible)"
36 ./pcretest testdata/testinput1 testtry
38 $cf testtry testdata/testoutput1
39 if [ $? != 0 ] ; then exit 1; fi
44 # PCRE tests that are not Perl-compatible - API & error tests, mostly
46 if [ $do2 = yes ] ; then
47 echo "Testing API and error handling (not Perl compatible)"
48 ./pcretest -i testdata/testinput2 testtry
50 $cf testtry testdata/testoutput2
51 if [ $? != 0 ] ; then exit 1; fi
56 # Additional Perl-compatible tests for Perl 5.005's new features
58 if [ $do3 = yes ] ; then
59 echo "Testing Perl 5.005 features (Perl 5.005 compatible)"
60 ./pcretest testdata/testinput3 testtry
62 $cf testtry testdata/testoutput3
63 if [ $? != 0 ] ; then exit 1; fi
68 if [ $do1 = yes -a $do2 = yes -a $do3 = yes ] ; then
69 echo "The three main tests all ran OK"
73 # Locale-specific tests, provided the "fr" locale is available
75 if [ $do4 = yes ] ; then
76 locale -a | grep '^fr$' >/dev/null
77 if [ $? -eq 0 ] ; then
78 echo "Testing locale-specific features (using 'fr' locale)"
79 ./pcretest testdata/testinput4 testtry
81 $cf testtry testdata/testoutput4
82 if [ $? != 0 ] ; then exit 1; fi
83 echo "Locale test ran OK"
88 echo "Cannot test locale-specific features - 'fr' locale not found,"
89 echo "or the \"locale\" command is not available to check for it."