6 |
# Run PCRE tests |
# Run PCRE tests |
7 |
|
|
8 |
cf=diff |
cf=diff |
9 |
testdata=@top_srcdir@/testdata |
valgrind= |
10 |
|
if [ ! -d testdata ] ; then |
11 |
|
ln -s @top_srcdir@/testdata testdata |
12 |
|
fi |
13 |
|
testdata=./testdata |
14 |
|
|
15 |
|
|
16 |
# Select which tests to run; if no selection, run all |
# Select which tests to run; if no selection, run all |
17 |
|
|
36 |
7) do7=yes;; |
7) do7=yes;; |
37 |
8) do8=yes;; |
8) do8=yes;; |
38 |
9) do9=yes;; |
9) do9=yes;; |
39 |
|
valgrind) valgrind="valgrind -q";; |
40 |
*) echo "Unknown test number $1"; exit 1;; |
*) echo "Unknown test number $1"; exit 1;; |
41 |
esac |
esac |
42 |
shift |
shift |
113 |
|
|
114 |
if [ $do1 = yes ] ; then |
if [ $do1 = yes ] ; then |
115 |
echo "Test 1: main functionality (Perl compatible)" |
echo "Test 1: main functionality (Perl compatible)" |
116 |
./pcretest $testdata/testinput1 testtry |
$valgrind ./pcretest -q $testdata/testinput1 testtry |
117 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
118 |
$cf testtry $testdata/testoutput1 |
$cf testtry $testdata/testoutput1 |
119 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
128 |
if [ $do2 = yes ] ; then |
if [ $do2 = yes ] ; then |
129 |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
130 |
echo "Test 2: API and error handling (not Perl compatible)" |
echo "Test 2: API and error handling (not Perl compatible)" |
131 |
./pcretest -i $testdata/testinput2 testtry |
$valgrind ./pcretest -q $testdata/testinput2 testtry |
132 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
133 |
$cf testtry $testdata/testoutput2 |
$cf testtry $testdata/testoutput2 |
134 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
148 |
locale -a | grep '^fr_FR$' >/dev/null |
locale -a | grep '^fr_FR$' >/dev/null |
149 |
if [ $? -eq 0 ] ; then |
if [ $? -eq 0 ] ; then |
150 |
echo "Test 3: locale-specific features (using 'fr_FR' locale)" |
echo "Test 3: locale-specific features (using 'fr_FR' locale)" |
151 |
./pcretest $testdata/testinput3 testtry |
$valgrind ./pcretest -q $testdata/testinput3 testtry |
152 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
153 |
$cf testtry $testdata/testoutput3 |
$cf testtry $testdata/testoutput3 |
154 |
if [ $? != 0 ] ; then |
if [ $? != 0 ] ; then |
173 |
|
|
174 |
if [ $do4 = yes ] ; then |
if [ $do4 = yes ] ; then |
175 |
echo "Test 4: UTF-8 support (Perl compatible)" |
echo "Test 4: UTF-8 support (Perl compatible)" |
176 |
./pcretest $testdata/testinput4 testtry |
$valgrind ./pcretest -q $testdata/testinput4 testtry |
177 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
178 |
$cf testtry $testdata/testoutput4 |
$cf testtry $testdata/testoutput4 |
179 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
186 |
if [ $do5 = yes ] ; then |
if [ $do5 = yes ] ; then |
187 |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
188 |
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)" |
189 |
./pcretest $testdata/testinput5 testtry |
$valgrind ./pcretest -q $testdata/testinput5 testtry |
190 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
191 |
$cf testtry $testdata/testoutput5 |
$cf testtry $testdata/testoutput5 |
192 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
203 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
204 |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then |
205 |
echo "Test 6: Unicode property support" |
echo "Test 6: Unicode property support" |
206 |
./pcretest $testdata/testinput6 testtry |
$valgrind ./pcretest -q $testdata/testinput6 testtry |
207 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
208 |
$cf testtry $testdata/testoutput6 |
$cf testtry $testdata/testoutput6 |
209 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
221 |
|
|
222 |
if [ $do7 = yes ] ; then |
if [ $do7 = yes ] ; then |
223 |
echo "Test 7: DFA matching" |
echo "Test 7: DFA matching" |
224 |
./pcretest -dfa $testdata/testinput7 testtry |
$valgrind ./pcretest -q -dfa $testdata/testinput7 testtry |
225 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
226 |
$cf testtry $testdata/testoutput7 |
$cf testtry $testdata/testoutput7 |
227 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
233 |
|
|
234 |
if [ $do8 = yes ] ; then |
if [ $do8 = yes ] ; then |
235 |
echo "Test 8: DFA matching with UTF-8" |
echo "Test 8: DFA matching with UTF-8" |
236 |
./pcretest -dfa $testdata/testinput8 testtry |
$valgrind ./pcretest -q -dfa $testdata/testinput8 testtry |
237 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
238 |
$cf testtry $testdata/testoutput8 |
$cf testtry $testdata/testoutput8 |
239 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
245 |
|
|
246 |
if [ $do9 = yes ] ; then |
if [ $do9 = yes ] ; then |
247 |
echo "Test 9: DFA matching with Unicode properties" |
echo "Test 9: DFA matching with Unicode properties" |
248 |
./pcretest -dfa $testdata/testinput9 testtry |
$valgrind ./pcretest -q -dfa $testdata/testinput9 testtry |
249 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
250 |
$cf testtry $testdata/testoutput9 |
$cf testtry $testdata/testoutput9 |
251 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |