| 1 |
#! /bin/sh
|
| 2 |
|
| 3 |
# This file is generated by configure from RunTest.in. Make any changes
|
| 4 |
# to that file.
|
| 5 |
|
| 6 |
# Run PCRE tests
|
| 7 |
|
| 8 |
cf=diff
|
| 9 |
testdata=@top_srcdir@/testdata
|
| 10 |
|
| 11 |
# Select which tests to run; if no selection, run all
|
| 12 |
|
| 13 |
do1=no
|
| 14 |
do2=no
|
| 15 |
do3=no
|
| 16 |
do4=no
|
| 17 |
do5=no
|
| 18 |
do6=no
|
| 19 |
|
| 20 |
while [ $# -gt 0 ] ; do
|
| 21 |
case $1 in
|
| 22 |
1) do1=yes;;
|
| 23 |
2) do2=yes;;
|
| 24 |
3) do3=yes;;
|
| 25 |
4) do4=yes;;
|
| 26 |
5) do5=yes;;
|
| 27 |
6) do6=yes;;
|
| 28 |
*) echo "Unknown test number $1"; exit 1;;
|
| 29 |
esac
|
| 30 |
shift
|
| 31 |
done
|
| 32 |
|
| 33 |
if [ "@UTF8@" = "" ] ; then
|
| 34 |
if [ $do5 = yes ] ; then
|
| 35 |
echo "Can't run test 5 because UFT8 support is not configured"
|
| 36 |
exit 1
|
| 37 |
fi
|
| 38 |
if [ $do6 = yes ] ; then
|
| 39 |
echo "Can't run test 6 because UFT8 support is not configured"
|
| 40 |
exit 1
|
| 41 |
fi
|
| 42 |
fi
|
| 43 |
|
| 44 |
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a\
|
| 45 |
$do5 = no -a $do6 = no ] ; then
|
| 46 |
do1=yes
|
| 47 |
do2=yes
|
| 48 |
do3=yes
|
| 49 |
do4=yes
|
| 50 |
if [ "@UTF8@" != "" ] ; then do5=yes; fi
|
| 51 |
if [ "@UTF8@" != "" ] ; then do6=yes; fi
|
| 52 |
fi
|
| 53 |
|
| 54 |
# Primary test, Perl-compatible
|
| 55 |
|
| 56 |
if [ $do1 = yes ] ; then
|
| 57 |
echo "Testing main functionality (Perl compatible)"
|
| 58 |
./pcretest $testdata/testinput1 testtry
|
| 59 |
if [ $? = 0 ] ; then
|
| 60 |
$cf testtry $testdata/testoutput1
|
| 61 |
if [ $? != 0 ] ; then exit 1; fi
|
| 62 |
else exit 1
|
| 63 |
fi
|
| 64 |
fi
|
| 65 |
|
| 66 |
# PCRE tests that are not Perl-compatible - API & error tests, mostly
|
| 67 |
|
| 68 |
if [ $do2 = yes ] ; then
|
| 69 |
echo "Testing API and error handling (not Perl compatible)"
|
| 70 |
./pcretest -i $testdata/testinput2 testtry
|
| 71 |
if [ $? = 0 ] ; then
|
| 72 |
$cf testtry $testdata/testoutput2
|
| 73 |
if [ $? != 0 ] ; then exit 1; fi
|
| 74 |
else exit 1
|
| 75 |
fi
|
| 76 |
fi
|
| 77 |
|
| 78 |
# Additional Perl-compatible tests for Perl 5.005's new features
|
| 79 |
|
| 80 |
if [ $do3 = yes ] ; then
|
| 81 |
echo "Testing Perl 5.005 features (Perl 5.005 compatible)"
|
| 82 |
./pcretest $testdata/testinput3 testtry
|
| 83 |
if [ $? = 0 ] ; then
|
| 84 |
$cf testtry $testdata/testoutput3
|
| 85 |
if [ $? != 0 ] ; then exit 1; fi
|
| 86 |
else exit 1
|
| 87 |
fi
|
| 88 |
fi
|
| 89 |
|
| 90 |
if [ $do1 = yes -a $do2 = yes -a $do3 = yes ] ; then
|
| 91 |
echo " "
|
| 92 |
echo "The three main tests all ran OK"
|
| 93 |
echo " "
|
| 94 |
fi
|
| 95 |
|
| 96 |
# Locale-specific tests, provided the "fr" locale is available
|
| 97 |
|
| 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
|
| 103 |
if [ $? = 0 ] ; then
|
| 104 |
$cf testtry $testdata/testoutput4
|
| 105 |
if [ $? != 0 ] ; then
|
| 106 |
echo " "
|
| 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."
|
| 110 |
else
|
| 111 |
echo "Locale test ran OK"
|
| 112 |
fi
|
| 113 |
echo " "
|
| 114 |
else exit 1
|
| 115 |
fi
|
| 116 |
else
|
| 117 |
echo "Cannot test locale-specific features - 'fr' locale not found,"
|
| 118 |
echo "or the \"locale\" command is not available to check for it."
|
| 119 |
echo " "
|
| 120 |
fi
|
| 121 |
fi
|
| 122 |
|
| 123 |
# Additional tests for UTF8 support
|
| 124 |
|
| 125 |
if [ $do5 = yes ] ; then
|
| 126 |
echo "Testing experimental, incomplete UTF8 support (Perl compatible)"
|
| 127 |
./pcretest $testdata/testinput5 testtry
|
| 128 |
if [ $? = 0 ] ; then
|
| 129 |
$cf testtry $testdata/testoutput5
|
| 130 |
if [ $? != 0 ] ; then exit 1; fi
|
| 131 |
else exit 1
|
| 132 |
fi
|
| 133 |
echo "UTF8 test ran OK"
|
| 134 |
echo " "
|
| 135 |
fi
|
| 136 |
|
| 137 |
if [ $do6 = yes ] ; then
|
| 138 |
echo "Testing API and internals for UTF8 support (not Perl compatible)"
|
| 139 |
./pcretest $testdata/testinput6 testtry
|
| 140 |
if [ $? = 0 ] ; then
|
| 141 |
$cf testtry $testdata/testoutput6
|
| 142 |
if [ $? != 0 ] ; then exit 1; fi
|
| 143 |
else exit 1
|
| 144 |
fi
|
| 145 |
echo "UTF8 internals test ran OK"
|
| 146 |
echo " "
|
| 147 |
fi
|
| 148 |
|
| 149 |
# End
|