| 10 |
|
|
| 11 |
pcregrep=`pwd`/pcregrep |
pcregrep=`pwd`/pcregrep |
| 12 |
|
|
|
echo " " |
|
|
echo "Testing pcregrep" |
|
|
$pcregrep -V |
|
|
|
|
| 13 |
valgrind= |
valgrind= |
| 14 |
while [ $# -gt 0 ] ; do |
while [ $# -gt 0 ] ; do |
| 15 |
case $1 in |
case $1 in |
| 16 |
valgrind) valgrind="valgrind -q --leak-check=no";; |
valgrind) valgrind="valgrind -q --leak-check=no --smc-check=all";; |
| 17 |
*) echo "Unknown argument $1"; exit 1;; |
*) echo "RunGrepTest: Unknown argument $1"; exit 1;; |
| 18 |
esac |
esac |
| 19 |
shift |
shift |
| 20 |
done |
done |
| 21 |
|
|
| 22 |
|
echo " " |
| 23 |
|
if [ "$valgrind" = "" ] ; then |
| 24 |
|
echo "Testing pcregrep" |
| 25 |
|
else |
| 26 |
|
echo "Testing pcregrep using valgrind" |
| 27 |
|
fi |
| 28 |
|
|
| 29 |
|
$pcregrep -V |
| 30 |
|
|
| 31 |
cf="diff -ub" |
cf="diff -ub" |
| 32 |
|
|
| 33 |
# Set up a suitable "diff" command for comparison. Some systems have a diff |
# Set up a suitable "diff" command for comparison. Some systems have a diff |
| 192 |
echo "RC=$?" >>testtry |
echo "RC=$?" >>testtry |
| 193 |
|
|
| 194 |
echo "---------------------------- Test 35 -----------------------------" >>testtry |
echo "---------------------------- Test 35 -----------------------------" >>testtry |
| 195 |
(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinputx --exclude_dir='^\.' 'fox' ./testdata) >>testtry |
(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinputx --exclude-dir='^\.' 'fox' ./testdata) >>testtry |
| 196 |
echo "RC=$?" >>testtry |
echo "RC=$?" >>testtry |
| 197 |
|
|
| 198 |
echo "---------------------------- Test 36 -----------------------------" >>testtry |
echo "---------------------------- Test 36 -----------------------------" >>testtry |
| 305 |
echo "RC=$?" >>testtry |
echo "RC=$?" >>testtry |
| 306 |
|
|
| 307 |
echo "---------------------------- Test 62 -----------------------------" >>testtry |
echo "---------------------------- Test 62 -----------------------------" >>testtry |
| 308 |
(cd $srcdir; $valgrind $pcregrep --match-limit=1000 -M 'This is a file(.|\R)*file.' ./testdata/grepinput) >>testtry 2>&1 |
(cd $srcdir; $valgrind $pcregrep --match-limit=1000 --no-jit -M 'This is a file(.|\R)*file.' ./testdata/grepinput) >>testtry 2>&1 |
| 309 |
echo "RC=$?" >>testtry |
echo "RC=$?" >>testtry |
| 310 |
|
|
| 311 |
echo "---------------------------- Test 63 -----------------------------" >>testtry |
echo "---------------------------- Test 63 -----------------------------" >>testtry |
| 312 |
(cd $srcdir; $valgrind $pcregrep --recursion-limit=1000 -M 'This is a file(.|\R)*file.' ./testdata/grepinput) >>testtry 2>&1 |
(cd $srcdir; $valgrind $pcregrep --recursion-limit=1000 --no-jit -M 'This is a file(.|\R)*file.' ./testdata/grepinput) >>testtry 2>&1 |
| 313 |
echo "RC=$?" >>testtry |
echo "RC=$?" >>testtry |
| 314 |
|
|
| 315 |
echo "---------------------------- Test 64 ------------------------------" >>testtry |
echo "---------------------------- Test 64 ------------------------------" >>testtry |
| 332 |
(cd $srcdir; $valgrind $pcregrep --only-matching=2 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry |
(cd $srcdir; $valgrind $pcregrep --only-matching=2 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry |
| 333 |
echo "RC=$?" >>testtry |
echo "RC=$?" >>testtry |
| 334 |
|
|
| 335 |
|
echo "---------------------------- Test 69 -----------------------------" >>testtry |
| 336 |
|
(cd $srcdir; $valgrind $pcregrep -vn --colour=always pattern ./testdata/grepinputx) >>testtry |
| 337 |
|
echo "RC=$?" >>testtry |
| 338 |
|
|
| 339 |
|
echo "---------------------------- Test 70 -----------------------------" >>testtry |
| 340 |
|
(cd $srcdir; $valgrind $pcregrep --color=always -M "triple:\t.*\n\n" ./testdata/grepinput3) >>testtry |
| 341 |
|
echo "RC=$?" >>testtry |
| 342 |
|
|
| 343 |
|
echo "---------------------------- Test 71 -----------------------------" >>testtry |
| 344 |
|
(cd $srcdir; $valgrind $pcregrep -o "^01|^02|^03" ./testdata/grepinput) >>testtry |
| 345 |
|
echo "RC=$?" >>testtry |
| 346 |
|
|
| 347 |
|
echo "---------------------------- Test 72 -----------------------------" >>testtry |
| 348 |
|
(cd $srcdir; $valgrind $pcregrep --color=always "^01|^02|^03" ./testdata/grepinput) >>testtry |
| 349 |
|
echo "RC=$?" >>testtry |
| 350 |
|
|
| 351 |
|
echo "---------------------------- Test 73 -----------------------------" >>testtry |
| 352 |
|
(cd $srcdir; $valgrind $pcregrep -o --colour=always "^01|^02|^03" ./testdata/grepinput) >>testtry |
| 353 |
|
echo "RC=$?" >>testtry |
| 354 |
|
|
| 355 |
|
echo "---------------------------- Test 74 -----------------------------" >>testtry |
| 356 |
|
(cd $srcdir; $valgrind $pcregrep -o "^01|02|^03" ./testdata/grepinput) >>testtry |
| 357 |
|
echo "RC=$?" >>testtry |
| 358 |
|
|
| 359 |
|
echo "---------------------------- Test 75 -----------------------------" >>testtry |
| 360 |
|
(cd $srcdir; $valgrind $pcregrep --color=always "^01|02|^03" ./testdata/grepinput) >>testtry |
| 361 |
|
echo "RC=$?" >>testtry |
| 362 |
|
|
| 363 |
|
echo "---------------------------- Test 76 -----------------------------" >>testtry |
| 364 |
|
(cd $srcdir; $valgrind $pcregrep -o --colour=always "^01|02|^03" ./testdata/grepinput) >>testtry |
| 365 |
|
echo "RC=$?" >>testtry |
| 366 |
|
|
| 367 |
|
echo "---------------------------- Test 77 -----------------------------" >>testtry |
| 368 |
|
(cd $srcdir; $valgrind $pcregrep -o "^01|^02|03" ./testdata/grepinput) >>testtry |
| 369 |
|
echo "RC=$?" >>testtry |
| 370 |
|
|
| 371 |
|
echo "---------------------------- Test 78 -----------------------------" >>testtry |
| 372 |
|
(cd $srcdir; $valgrind $pcregrep --color=always "^01|^02|03" ./testdata/grepinput) >>testtry |
| 373 |
|
echo "RC=$?" >>testtry |
| 374 |
|
|
| 375 |
|
echo "---------------------------- Test 79 -----------------------------" >>testtry |
| 376 |
|
(cd $srcdir; $valgrind $pcregrep -o --colour=always "^01|^02|03" ./testdata/grepinput) >>testtry |
| 377 |
|
echo "RC=$?" >>testtry |
| 378 |
|
|
| 379 |
|
echo "---------------------------- Test 80 -----------------------------" >>testtry |
| 380 |
|
(cd $srcdir; $valgrind $pcregrep -o "\b01|\b02" ./testdata/grepinput) >>testtry |
| 381 |
|
echo "RC=$?" >>testtry |
| 382 |
|
|
| 383 |
|
echo "---------------------------- Test 81 -----------------------------" >>testtry |
| 384 |
|
(cd $srcdir; $valgrind $pcregrep --color=always "\\b01|\\b02" ./testdata/grepinput) >>testtry |
| 385 |
|
echo "RC=$?" >>testtry |
| 386 |
|
|
| 387 |
|
echo "---------------------------- Test 82 -----------------------------" >>testtry |
| 388 |
|
(cd $srcdir; $valgrind $pcregrep -o --colour=always "\\b01|\\b02" ./testdata/grepinput) >>testtry |
| 389 |
|
echo "RC=$?" >>testtry |
| 390 |
|
|
| 391 |
|
echo "---------------------------- Test 83 -----------------------------" >>testtry |
| 392 |
|
(cd $srcdir; $valgrind $pcregrep --buffer-size=100 "^a" ./testdata/grepinput3) >>testtry 2>&1 |
| 393 |
|
echo "RC=$?" >>testtry |
| 394 |
|
|
| 395 |
# Now compare the results. |
# Now compare the results. |
| 396 |
|
|
| 397 |
$cf $srcdir/testdata/grepoutput testtry |
$cf $srcdir/testdata/grepoutput testtry |