3 # This file is generated by configure from RunTest.in. Make any changes
9 testdata=@top_srcdir@/testdata
11 # Select which tests to run; if no selection, run all
20 while [ $# -gt 0 ] ; do
28 *) echo "Unknown test number $1"; exit 1;;
33 if [ "@UTF8@" = "" ] ; then
34 if [ $do5 = yes ] ; then
35 echo "Can't run test 5 because UFT8 support is not configured"
38 if [ $do6 = yes ] ; then
39 echo "Can't run test 6 because UFT8 support is not configured"
44 if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a\
45 $do5 = no -a $do6 = no ] ; then
50 if [ "@UTF8@" != "" ] ; then do5=yes; fi
51 if [ "@UTF8@" != "" ] ; then do6=yes; fi
54 # Primary test, Perl-compatible
56 if [ $do1 = yes ] ; then
57 echo "Testing main functionality (Perl compatible)"
58 ./pcretest $testdata/testinput1 testtry
60 $cf testtry $testdata/testoutput1
61 if [ $? != 0 ] ; then exit 1; fi
66 # PCRE tests that are not Perl-compatible - API & error tests, mostly
68 if [ $do2 = yes ] ; then
69 echo "Testing API and error handling (not Perl compatible)"
70 ./pcretest -i $testdata/testinput2 testtry
72 $cf testtry $testdata/testoutput2
73 if [ $? != 0 ] ; then exit 1; fi
78 # Additional Perl-compatible tests for Perl 5.005's new features
80 if [ $do3 = yes ] ; then
81 echo "Testing Perl 5.005 features (Perl 5.005 compatible)"
82 ./pcretest $testdata/testinput3 testtry
84 $cf testtry $testdata/testoutput3
85 if [ $? != 0 ] ; then exit 1; fi
90 if [ $do1 = yes -a $do2 = yes -a $do3 = yes ] ; then
92 echo "The three main tests all ran OK"
96 # Locale-specific tests, provided the "fr" locale is available
98 if [ $do4 = yes ] ; then
99 locale -a | grep '^fr$' >/dev/null
100 if [ $? -eq 0 ] ; then
101 echo "Testing locale-specific features (using 'fr' locale)"
102 ./pcretest $testdata/testinput4 testtry
104 $cf testtry $testdata/testoutput4
105 if [ $? != 0 ] ; then
107 echo "Locale test did not run entirely successfully."
108 echo "This usually means that there is a problem with the locale"
109 echo "settings rather than a bug in PCRE."
111 echo "Locale test ran OK"
117 echo "Cannot test locale-specific features - 'fr' locale not found,"
118 echo "or the \"locale\" command is not available to check for it."
123 # Additional tests for UTF8 support
125 if [ $do5 = yes ] ; then
126 echo "Testing experimental, incomplete UTF8 support (Perl compatible)"
127 ./pcretest $testdata/testinput5 testtry
129 $cf testtry $testdata/testoutput5
130 if [ $? != 0 ] ; then exit 1; fi
133 echo "UTF8 test ran OK"
137 if [ $do6 = yes ] ; then
138 echo "Testing API and internals for UTF8 support (not Perl compatible)"
139 ./pcretest $testdata/testinput6 testtry
141 $cf testtry $testdata/testoutput6
142 if [ $? != 0 ] ; then exit 1; fi
145 echo "UTF8 internals test ran OK"