| 3 |
# This file is generated by configure from RunTest.in. Make any changes |
# This file is generated by configure from RunTest.in. Make any changes |
| 4 |
# to that file. |
# to that file. |
| 5 |
|
|
| 6 |
|
# TODO: Replace use of variables @LINK_SIZE@, @UTF8@ and @UCP@ with |
| 7 |
|
# the data found from the output of 'pcretest -C' instead. |
| 8 |
|
|
| 9 |
# Run PCRE tests |
# Run PCRE tests |
| 10 |
|
|
| 11 |
cf=diff |
cf=diff |
| 12 |
testdata=@top_srcdir@/testdata |
valgrind= |
| 13 |
|
if [ ! -d testdata ] ; then |
| 14 |
|
ln -s @top_srcdir@/testdata testdata |
| 15 |
|
fi |
| 16 |
|
testdata=./testdata |
| 17 |
|
|
| 18 |
|
|
| 19 |
# Select which tests to run; if no selection, run all |
# Select which tests to run; if no selection, run all |
| 20 |
|
|
| 39 |
7) do7=yes;; |
7) do7=yes;; |
| 40 |
8) do8=yes;; |
8) do8=yes;; |
| 41 |
9) do9=yes;; |
9) do9=yes;; |
| 42 |
|
valgrind) valgrind="valgrind -q";; |
| 43 |
*) echo "Unknown test number $1"; exit 1;; |
*) echo "Unknown test number $1"; exit 1;; |
| 44 |
esac |
esac |
| 45 |
shift |
shift |
| 46 |
done |
done |
| 47 |
|
|
| 48 |
if [ "@LINK_SIZE@" != "" -a "@LINK_SIZE@" != "-DLINK_SIZE=2" ] ; then |
if [ "@LINK_SIZE@" != "2" ] ; then |
| 49 |
if [ $do2 = yes ] ; then |
if [ $do2 = yes ] ; then |
| 50 |
echo "Can't run test 2 with an internal link size other than 2" |
echo "Can't run test 2 with an internal link size other than 2" |
| 51 |
exit 1 |
exit 1 |
| 60 |
fi |
fi |
| 61 |
fi |
fi |
| 62 |
|
|
| 63 |
if [ "@UTF8@" = "" ] ; then |
if [ "@UTF8@" = "no" ] ; then |
| 64 |
if [ $do4 = yes ] ; then |
if [ $do4 = yes ] ; then |
| 65 |
echo "Can't run test 4 because UTF-8 support is not configured" |
echo "Can't run test 4 because UTF-8 support is not configured" |
| 66 |
exit 1 |
exit 1 |
| 83 |
fi |
fi |
| 84 |
fi |
fi |
| 85 |
|
|
| 86 |
if [ "@UCP@" = "" ] ; then |
if [ "@UCP@" = "no" ] ; then |
| 87 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
| 88 |
echo "Can't run test 6 because Unicode property support is not configured" |
echo "Can't run test 6 because Unicode property support is not configured" |
| 89 |
exit 1 |
exit 1 |
| 100 |
do1=yes |
do1=yes |
| 101 |
do2=yes |
do2=yes |
| 102 |
do3=yes |
do3=yes |
| 103 |
if [ "@UTF8@" != "" ] ; then do4=yes; fi |
if [ "@UTF8@" != "no" ] ; then do4=yes; fi |
| 104 |
if [ "@UTF8@" != "" ] ; then do5=yes; fi |
if [ "@UTF8@" != "no" ] ; then do5=yes; fi |
| 105 |
if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do6=yes; fi |
if [ "@UTF8@" != "no" -a "@UCP@" != "no" ] ; then do6=yes; fi |
| 106 |
do7=yes |
do7=yes |
| 107 |
if [ "@UTF8@" != "" ] ; then do8=yes; fi |
if [ "@UTF8@" != "no" ] ; then do8=yes; fi |
| 108 |
if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do9=yes; fi |
if [ "@UTF8@" != "no" -a "@UCP@" != "no" ] ; then do9=yes; fi |
| 109 |
fi |
fi |
| 110 |
|
|
| 111 |
# Show which release |
# Show which release |
| 116 |
|
|
| 117 |
if [ $do1 = yes ] ; then |
if [ $do1 = yes ] ; then |
| 118 |
echo "Test 1: main functionality (Perl compatible)" |
echo "Test 1: main functionality (Perl compatible)" |
| 119 |
./pcretest $testdata/testinput1 testtry |
$valgrind ./pcretest -q $testdata/testinput1 testtry |
| 120 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 121 |
$cf testtry $testdata/testoutput1 |
$cf testtry $testdata/testoutput1 |
| 122 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 129 |
# PCRE tests that are not Perl-compatible - API & error tests, mostly |
# PCRE tests that are not Perl-compatible - API & error tests, mostly |
| 130 |
|
|
| 131 |
if [ $do2 = yes ] ; then |
if [ $do2 = yes ] ; then |
| 132 |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
if [ "@LINK_SIZE@" = "2" ] ; then |
| 133 |
echo "Test 2: API and error handling (not Perl compatible)" |
echo "Test 2: API and error handling (not Perl compatible)" |
| 134 |
./pcretest -i $testdata/testinput2 testtry |
$valgrind ./pcretest -q $testdata/testinput2 testtry |
| 135 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 136 |
$cf testtry $testdata/testoutput2 |
$cf testtry $testdata/testoutput2 |
| 137 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 141 |
echo " " |
echo " " |
| 142 |
else |
else |
| 143 |
echo Test 2 skipped for link size other than 2 \(@LINK_SIZE@\) |
echo Test 2 skipped for link size other than 2 \(@LINK_SIZE@\) |
| 144 |
echo " " |
echo " " |
| 145 |
fi |
fi |
| 146 |
fi |
fi |
| 147 |
|
|
| 151 |
locale -a | grep '^fr_FR$' >/dev/null |
locale -a | grep '^fr_FR$' >/dev/null |
| 152 |
if [ $? -eq 0 ] ; then |
if [ $? -eq 0 ] ; then |
| 153 |
echo "Test 3: locale-specific features (using 'fr_FR' locale)" |
echo "Test 3: locale-specific features (using 'fr_FR' locale)" |
| 154 |
./pcretest $testdata/testinput3 testtry |
$valgrind ./pcretest -q $testdata/testinput3 testtry |
| 155 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 156 |
$cf testtry $testdata/testoutput3 |
$cf testtry $testdata/testoutput3 |
| 157 |
if [ $? != 0 ] ; then |
if [ $? != 0 ] ; then |
| 176 |
|
|
| 177 |
if [ $do4 = yes ] ; then |
if [ $do4 = yes ] ; then |
| 178 |
echo "Test 4: UTF-8 support (Perl compatible)" |
echo "Test 4: UTF-8 support (Perl compatible)" |
| 179 |
./pcretest $testdata/testinput4 testtry |
$valgrind ./pcretest -q $testdata/testinput4 testtry |
| 180 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 181 |
$cf testtry $testdata/testoutput4 |
$cf testtry $testdata/testoutput4 |
| 182 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 187 |
fi |
fi |
| 188 |
|
|
| 189 |
if [ $do5 = yes ] ; then |
if [ $do5 = yes ] ; then |
| 190 |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
if [ "@LINK_SIZE@" = "2" ] ; then |
| 191 |
echo "Test 5: API and internals for UTF-8 support (not Perl compatible)" |
echo "Test 5: API and internals for UTF-8 support (not Perl compatible)" |
| 192 |
./pcretest $testdata/testinput5 testtry |
$valgrind ./pcretest -q $testdata/testinput5 testtry |
| 193 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 194 |
$cf testtry $testdata/testoutput5 |
$cf testtry $testdata/testoutput5 |
| 195 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 199 |
echo " " |
echo " " |
| 200 |
else |
else |
| 201 |
echo Test 5 skipped for link size other than 2 \(@LINK_SIZE@\) |
echo Test 5 skipped for link size other than 2 \(@LINK_SIZE@\) |
| 202 |
echo " " |
echo " " |
| 203 |
fi |
fi |
| 204 |
fi |
fi |
| 205 |
|
|
| 206 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
| 207 |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
if [ "@LINK_SIZE@" = "2" ] ; then |
| 208 |
echo "Test 6: Unicode property support" |
echo "Test 6: Unicode property support" |
| 209 |
./pcretest $testdata/testinput6 testtry |
$valgrind ./pcretest -q $testdata/testinput6 testtry |
| 210 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 211 |
$cf testtry $testdata/testoutput6 |
$cf testtry $testdata/testoutput6 |
| 212 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 216 |
echo " " |
echo " " |
| 217 |
else |
else |
| 218 |
echo Test 6 skipped for link size other than 2 \(@LINK_SIZE@\) |
echo Test 6 skipped for link size other than 2 \(@LINK_SIZE@\) |
| 219 |
echo " " |
echo " " |
| 220 |
fi |
fi |
| 221 |
fi |
fi |
| 222 |
|
|
| 224 |
|
|
| 225 |
if [ $do7 = yes ] ; then |
if [ $do7 = yes ] ; then |
| 226 |
echo "Test 7: DFA matching" |
echo "Test 7: DFA matching" |
| 227 |
./pcretest -dfa $testdata/testinput7 testtry |
$valgrind ./pcretest -q -dfa $testdata/testinput7 testtry |
| 228 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 229 |
$cf testtry $testdata/testoutput7 |
$cf testtry $testdata/testoutput7 |
| 230 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 236 |
|
|
| 237 |
if [ $do8 = yes ] ; then |
if [ $do8 = yes ] ; then |
| 238 |
echo "Test 8: DFA matching with UTF-8" |
echo "Test 8: DFA matching with UTF-8" |
| 239 |
./pcretest -dfa $testdata/testinput8 testtry |
$valgrind ./pcretest -q -dfa $testdata/testinput8 testtry |
| 240 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 241 |
$cf testtry $testdata/testoutput8 |
$cf testtry $testdata/testoutput8 |
| 242 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 248 |
|
|
| 249 |
if [ $do9 = yes ] ; then |
if [ $do9 = yes ] ; then |
| 250 |
echo "Test 9: DFA matching with Unicode properties" |
echo "Test 9: DFA matching with Unicode properties" |
| 251 |
./pcretest -dfa $testdata/testinput9 testtry |
$valgrind ./pcretest -q -dfa $testdata/testinput9 testtry |
| 252 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 253 |
$cf testtry $testdata/testoutput9 |
$cf testtry $testdata/testoutput9 |
| 254 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |