| 39 |
./pcretest -C | ./pcregrep 'No Unicode properties support' >/dev/null |
./pcretest -C | ./pcregrep 'No Unicode properties support' >/dev/null |
| 40 |
ucp=$? |
ucp=$? |
| 41 |
|
|
| 42 |
|
jitopt= |
| 43 |
|
./pcretest -C | ./pcregrep 'No Just-in-time compiler support' >/dev/null |
| 44 |
|
jit=$? |
| 45 |
|
if [ $jit -ne 0 ] ; then |
| 46 |
|
jitopt=-s+ |
| 47 |
|
fi |
| 48 |
|
|
| 49 |
# Select which tests to run; for those that are explicitly requested, check |
# Select which tests to run; for those that are explicitly requested, check |
| 50 |
# that the necessary optional facilities are available. |
# that the necessary optional facilities are available. |
| 51 |
|
|
| 77 |
10) do10=yes;; |
10) do10=yes;; |
| 78 |
11) do11=yes;; |
11) do11=yes;; |
| 79 |
12) do12=yes;; |
12) do12=yes;; |
| 80 |
13) do12=yes;; |
13) do13=yes;; |
| 81 |
valgrind) valgrind="valgrind -q";; |
valgrind) valgrind="valgrind -q --smc-check=all";; |
| 82 |
*) echo "Unknown test number $1"; exit 1;; |
*) echo "Unknown test number $1"; exit 1;; |
| 83 |
esac |
esac |
| 84 |
shift |
shift |
| 133 |
|
|
| 134 |
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ |
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ |
| 135 |
$do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \ |
$do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \ |
| 136 |
$do9 = no -a $do10 = no -a $do11 = no -a $do12 = no ] ; then |
$do9 = no -a $do10 = no -a $do11 = no -a $do12 = no -a \ |
| 137 |
|
$do13 = no ] ; then |
| 138 |
do1=yes |
do1=yes |
| 139 |
do2=yes |
do2=yes |
| 140 |
do3=yes |
do3=yes |
| 156 |
echo PCRE C library tests |
echo PCRE C library tests |
| 157 |
./pcretest /dev/null |
./pcretest /dev/null |
| 158 |
|
|
| 159 |
# Primary test, compatible with all versions of Perl >= 5.8 |
# Primary test, compatible with JIT and all versions of Perl >= 5.8 |
| 160 |
|
|
| 161 |
if [ $do1 = yes ] ; then |
if [ $do1 = yes ] ; then |
| 162 |
echo "Test 1: main functionality (Compatible with Perl >= 5.8)" |
echo "Test 1: main functionality (Compatible with Perl >= 5.8)" |
| 163 |
for opt in "" "-s"; do |
for opt in "" "-s" $jitopt; do |
| 164 |
$valgrind ./pcretest -q $opt $testdata/testinput1 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput1 testtry |
| 165 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 166 |
$cf $testdata/testoutput1 testtry |
$cf $testdata/testoutput1 testtry |
| 167 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 168 |
else exit 1 |
else exit 1 |
| 169 |
fi |
fi |
| 170 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" |
| 171 |
|
elif [ "$opt" = "-s+" ] ; then echo "OK with JIT study" |
| 172 |
|
else echo "OK" |
| 173 |
|
fi |
| 174 |
done |
done |
| 175 |
fi |
fi |
| 176 |
|
|
| 177 |
# PCRE tests that are not Perl-compatible - API, errors, internals |
# PCRE tests that are not JIT or Perl-compatible: API, errors, internals |
| 178 |
|
|
| 179 |
if [ $do2 = yes ] ; then |
if [ $do2 = yes ] ; then |
| 180 |
echo "Test 2: API, errors, internals, and non-Perl stuff" |
echo "Test 2: API, errors, internals, and non-Perl stuff" |
| 181 |
for opt in "" "-s"; do |
for opt in "" "-s" $jitopt; do |
| 182 |
$valgrind ./pcretest -q $opt $testdata/testinput2 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput2 testtry |
| 183 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 184 |
$cf $testdata/testoutput2 testtry |
$cf $testdata/testoutput2 testtry |
| 192 |
echo " " |
echo " " |
| 193 |
exit 1 |
exit 1 |
| 194 |
fi |
fi |
| 195 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" |
| 196 |
|
elif [ "$opt" = "-s+" ] ; then echo "OK with JIT study" |
| 197 |
|
else echo "OK" |
| 198 |
|
fi |
| 199 |
done |
done |
| 200 |
fi |
fi |
| 201 |
|
|
| 224 |
|
|
| 225 |
if [ "$locale" != "" ] ; then |
if [ "$locale" != "" ] ; then |
| 226 |
echo "Test 3: locale-specific features (using '$locale' locale)" |
echo "Test 3: locale-specific features (using '$locale' locale)" |
| 227 |
for opt in "" "-s"; do |
for opt in "" "-s" $jitopt; do |
| 228 |
$valgrind ./pcretest -q $opt $infile testtry |
$valgrind ./pcretest -q $opt $infile testtry |
| 229 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 230 |
$cf $outfile testtry |
$cf $outfile testtry |
| 235 |
echo "settings rather than a bug in PCRE." |
echo "settings rather than a bug in PCRE." |
| 236 |
break; |
break; |
| 237 |
else |
else |
| 238 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" |
| 239 |
|
elif [ "$opt" = "-s+" ] ; then echo "OK with JIT study" |
| 240 |
|
else echo "OK" |
| 241 |
|
fi |
| 242 |
fi |
fi |
| 243 |
else exit 1 |
else exit 1 |
| 244 |
fi |
fi |
| 255 |
|
|
| 256 |
if [ $do4 = yes ] ; then |
if [ $do4 = yes ] ; then |
| 257 |
echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)" |
echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)" |
| 258 |
for opt in "" "-s"; do |
for opt in "" "-s" $jitopt; do |
| 259 |
$valgrind ./pcretest -q $opt $testdata/testinput4 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput4 testtry |
| 260 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 261 |
$cf $testdata/testoutput4 testtry |
$cf $testdata/testoutput4 testtry |
| 262 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 263 |
else exit 1 |
else exit 1 |
| 264 |
fi |
fi |
| 265 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" |
| 266 |
|
elif [ "$opt" = "-s+" ] ; then echo "OK with JIT study" |
| 267 |
|
else echo "OK" |
| 268 |
|
fi |
| 269 |
done |
done |
| 270 |
fi |
fi |
| 271 |
|
|
| 272 |
if [ $do5 = yes ] ; then |
if [ $do5 = yes ] ; then |
| 273 |
echo "Test 5: API, internals, and non-Perl stuff for UTF-8 support" |
echo "Test 5: API, internals, and non-Perl stuff for UTF-8 support" |
| 274 |
for opt in "" "-s"; do |
for opt in "" "-s" $jitopt; do |
| 275 |
$valgrind ./pcretest -q $opt $testdata/testinput5 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput5 testtry |
| 276 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 277 |
$cf $testdata/testoutput5 testtry |
$cf $testdata/testoutput5 testtry |
| 278 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 279 |
else exit 1 |
else exit 1 |
| 280 |
fi |
fi |
| 281 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" |
| 282 |
|
elif [ "$opt" = "-s+" ] ; then echo "OK with JIT study" |
| 283 |
|
else echo "OK" |
| 284 |
|
fi |
| 285 |
done |
done |
| 286 |
fi |
fi |
| 287 |
|
|
| 288 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
| 289 |
echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)" |
echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)" |
| 290 |
for opt in "" "-s"; do |
for opt in "" "-s" $jitopt; do |
| 291 |
$valgrind ./pcretest -q $opt $testdata/testinput6 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput6 testtry |
| 292 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 293 |
$cf $testdata/testoutput6 testtry |
$cf $testdata/testoutput6 testtry |
| 294 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 295 |
else exit 1 |
else exit 1 |
| 296 |
fi |
fi |
| 297 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" |
| 298 |
|
elif [ "$opt" = "-s+" ] ; then echo "OK with JIT study" |
| 299 |
|
else echo "OK" |
| 300 |
|
fi |
| 301 |
done |
done |
| 302 |
fi |
fi |
| 303 |
|
|
| 365 |
|
|
| 366 |
if [ $do11 = yes ] ; then |
if [ $do11 = yes ] ; then |
| 367 |
echo "Test 11: Features from Perl >= 5.10 without UTF8 support" |
echo "Test 11: Features from Perl >= 5.10 without UTF8 support" |
| 368 |
for opt in "" "-s"; do |
for opt in "" "-s" $jitopt; do |
| 369 |
$valgrind ./pcretest -q $opt $testdata/testinput11 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput11 testtry |
| 370 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 371 |
$cf $testdata/testoutput11 testtry |
$cf $testdata/testoutput11 testtry |
| 372 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 373 |
else exit 1 |
else exit 1 |
| 374 |
fi |
fi |
| 375 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" |
| 376 |
|
elif [ "$opt" = "-s+" ] ; then echo "OK with JIT study" |
| 377 |
|
else echo "OK" |
| 378 |
|
fi |
| 379 |
done |
done |
| 380 |
fi |
fi |
| 381 |
|
|
| 383 |
|
|
| 384 |
if [ $do12 = yes ] ; then |
if [ $do12 = yes ] ; then |
| 385 |
echo "Test 12: Features from Perl >= 5.10 with UTF8 support" |
echo "Test 12: Features from Perl >= 5.10 with UTF8 support" |
| 386 |
for opt in "" "-s"; do |
for opt in "" "-s" $jitopt; do |
| 387 |
$valgrind ./pcretest -q $opt $testdata/testinput12 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput12 testtry |
| 388 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 389 |
$cf $testdata/testoutput12 testtry |
$cf $testdata/testoutput12 testtry |
| 390 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 391 |
else exit 1 |
else exit 1 |
| 392 |
fi |
fi |
| 393 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" |
| 394 |
|
elif [ "$opt" = "-s+" ] ; then echo "OK with JIT study" |
| 395 |
|
else echo "OK" |
| 396 |
|
fi |
| 397 |
done |
done |
| 398 |
fi |
fi |
| 399 |
|
|
| 401 |
|
|
| 402 |
if [ $do13 = yes ] ; then |
if [ $do13 = yes ] ; then |
| 403 |
echo "Test 13: API, internals, and non-Perl stuff for Unicode property support" |
echo "Test 13: API, internals, and non-Perl stuff for Unicode property support" |
| 404 |
for opt in "" "-s"; do |
for opt in "" "-s" $jitopt; do |
| 405 |
$valgrind ./pcretest -q $opt $testdata/testinput13 testtry |
$valgrind ./pcretest -q $opt $testdata/testinput13 testtry |
| 406 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
| 407 |
$cf $testdata/testoutput13 testtry |
$cf $testdata/testoutput13 testtry |
| 408 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
| 409 |
else exit 1 |
else exit 1 |
| 410 |
fi |
fi |
| 411 |
if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi |
if [ "$opt" = "-s" ] ; then echo "OK with study" |
| 412 |
|
elif [ "$opt" = "-s+" ] ; then echo "OK with JIT study" |
| 413 |
|
else echo "OK" |
| 414 |
|
fi |
| 415 |
done |
done |
| 416 |
fi |
fi |
| 417 |
|
|