| 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";; |
| 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 |
| 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 |
# Now compare the results. |
# Now compare the results. |
| 340 |
|
|
| 341 |
$cf $srcdir/testdata/grepoutput testtry |
$cf $srcdir/testdata/grepoutput testtry |