RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Arkadiusz Miskiewicz
  Root:   /v/rpm/cvs                       Email:  [EMAIL PROTECTED]
  Module: rpm                              Date:   01-Aug-2008 00:12:37
  Branch: HEAD                             Handle: 2008073122123600

  Modified files:
    rpm/rpmio               RunGrepTest

  Log:
    Run rpmgrep pcre test only if rpmgrep built with PCRE support.

  Summary:
    Revision    Changes     Path
    1.10        +189 -178   rpm/rpmio/RunGrepTest
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/rpmio/RunGrepTest
  ============================================================================
  $ cvs diff -u -r1.9 -r1.10 RunGrepTest
  --- rpm/rpmio/RunGrepTest     2 Jun 2008 21:00:47 -0000       1.9
  +++ rpm/rpmio/RunGrepTest     31 Jul 2008 22:12:36 -0000      1.10
  @@ -28,6 +28,11 @@
     utf8=0
   fi
   
  +grepwithpcre=1
  +if $pcregrep --version 2>&1 | grep -q "without PCRE"; then
  +  grepwithpcre=0
  +fi
  +
   #rpmrepo=`pwd`/rpmrepo
   #if [ -x $rpmrepo ]; then
   #  echo "Testing rpmrepo features"
  @@ -108,256 +113,262 @@
   #  echo "Skipping rpmdigest tests: $rpmdigest is not executable"
   #fi
   
  -echo " "
  -echo "Testing pcregrep"
  -$pcregrep -V
  +if [ "$grepwithpcre" -gt 0 ]; then
   
  -cf="diff -ub"
  -valgrind=
  +     echo " "
  +     echo "Testing pcregrep"
  +     $pcregrep -V
   
  -while [ $# -gt 0 ] ; do
  -  case $1 in
  -    valgrind) valgrind="valgrind -q --leak-check=no";;
  -    *) echo "Unknown argument $1"; exit 1;;
  -  esac
  -  shift
  -done
  +     cf="diff -ub"
  +     valgrind=
   
  -echo "---------------------------- Test 1 ------------------------------" 
>testtry
  -(cd $srcdir; $valgrind $pcregrep PATTERN ./testdata/grepinput) >>testtry
  +     while [ $# -gt 0 ] ; do
  +             case $1 in
  +                     valgrind) valgrind="valgrind -q --leak-check=no";;
  +                     *) echo "Unknown argument $1"; exit 1;;
  +             esac
  +             shift
  +     done
   
  +     echo "---------------------------- Test 1 
------------------------------" >testtry
  +     (cd $srcdir; $valgrind $pcregrep PATTERN ./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 1 ------------------------------" 
>testtry
  -(cd $srcdir; $valgrind $pcregrep PATTERN ./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 2 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep '^PATTERN' ./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 1 
------------------------------" >testtry
  +     (cd $srcdir; $valgrind $pcregrep PATTERN ./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 3 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -in PATTERN ./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 2 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep '^PATTERN' ./testdata/grepinput) 
>>testtry
   
  -echo "---------------------------- Test 4 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -ic PATTERN ./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 3 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -in PATTERN ./testdata/grepinput) 
>>testtry
   
  -echo "---------------------------- Test 5 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -in PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 4 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -ic PATTERN ./testdata/grepinput) 
>>testtry
   
  -echo "---------------------------- Test 6 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -inh PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 5 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -in PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 7 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -il PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 6 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -inh PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 8 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -l PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 7 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -il PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 9 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -q PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  -echo "RC=$?" >>testtry
  +     echo "---------------------------- Test 8 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -l PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 10 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -q NEVER-PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  -echo "RC=$?" >>testtry
  +     echo "---------------------------- Test 9 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -q PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  +     echo "RC=$?" >>testtry
   
  -echo "---------------------------- Test 11 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -vn pattern ./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 10 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -q NEVER-PATTERN ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  +     echo "RC=$?" >>testtry
   
  -echo "---------------------------- Test 12 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -ix pattern ./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 11 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -vn pattern ./testdata/grepinputx) 
>>testtry
   
  -echo "---------------------------- Test 13 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -f./testdata/greplist 
./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 12 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -ix pattern ./testdata/grepinputx) 
>>testtry
   
  -echo "---------------------------- Test 14 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -w pat ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 13 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -f./testdata/greplist 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 15 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep 'abc^*' ./testdata/grepinput) 2>>testtry 
>>testtry
  +     echo "---------------------------- Test 14 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -w pat ./testdata/grepinput 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 16 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep abc ./testdata/grepinput 
./testdata/nonexistfile) 2>>testtry >>testtry
  +     echo "---------------------------- Test 15 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep 'abc^*' ./testdata/grepinput) 
2>>testtry >>testtry
   
  -echo "---------------------------- Test 17 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -M 'the\noutput' ./testdata/grepinput) 
>>testtry
  +     echo "---------------------------- Test 16 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep abc ./testdata/grepinput 
./testdata/nonexistfile) 2>>testtry >>testtry
   
  -echo "---------------------------- Test 18 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -Mn '(the\noutput|dog\.\n--)' 
./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 17 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -M 'the\noutput' ./testdata/grepinput) 
>>testtry
   
  -echo "---------------------------- Test 19 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -Mix 'Pattern' ./testdata/grepinputx) 
>>testtry
  +     echo "---------------------------- Test 18 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -Mn '(the\noutput|dog\.\n--)' 
./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 20 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -Mixn 'complete pair\nof lines' 
./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 19 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -Mix 'Pattern' ./testdata/grepinputx) 
>>testtry
   
  -echo "---------------------------- Test 21 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -nA3 'four' ./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 20 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -Mixn 'complete pair\nof lines' 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 22 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -nB3 'four' ./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 21 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -nA3 'four' ./testdata/grepinputx) 
>>testtry
   
  -echo "---------------------------- Test 23 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -C3 'four' ./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 22 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -nB3 'four' ./testdata/grepinputx) 
>>testtry
   
  -echo "---------------------------- Test 24 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -A9 'four' ./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 23 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -C3 'four' ./testdata/grepinputx) 
>>testtry
   
  -echo "---------------------------- Test 25 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -nB9 'four' ./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 24 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -A9 'four' ./testdata/grepinputx) 
>>testtry
   
  -echo "---------------------------- Test 26 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -A9 -B9 'four' ./testdata/grepinputx) 
>>testtry
  +     echo "---------------------------- Test 25 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -nB9 'four' ./testdata/grepinputx) 
>>testtry
   
  -echo "---------------------------- Test 27 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -A10 'four' ./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 26 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -A9 -B9 'four' ./testdata/grepinputx) 
>>testtry
   
  -echo "---------------------------- Test 28 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -nB10 'four' ./testdata/grepinputx) 
>>testtry
  +     echo "---------------------------- Test 27 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -A10 'four' ./testdata/grepinputx) 
>>testtry
   
  -echo "---------------------------- Test 29 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -C12 -B10 'four' ./testdata/grepinputx) 
>>testtry
  +     echo "---------------------------- Test 28 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -nB10 'four' ./testdata/grepinputx) 
>>testtry
   
  -echo "---------------------------- Test 30 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -inB3 'pattern' ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 29 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -C12 -B10 'four' 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 31 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -inA3 'pattern' ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 30 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -inB3 'pattern' ./testdata/grepinput 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 32 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -L 'fox' ./testdata/grepinput 
./testdata/grepinputx) >>testtry
  +     echo "---------------------------- Test 31 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -inA3 'pattern' ./testdata/grepinput 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 33 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep 'fox' ./testdata/grepnonexist) >>testtry 
2>&1
  -echo "RC=$?" >>testtry
  +     echo "---------------------------- Test 32 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -L 'fox' ./testdata/grepinput 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 34 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -s 'fox' ./testdata/grepnonexist) >>testtry 
2>&1
  -echo "RC=$?" >>testtry
  +     echo "---------------------------- Test 33 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep 'fox' ./testdata/grepnonexist) 
>>testtry 2>&1
  +     echo "RC=$?" >>testtry
   
  -echo "---------------------------- Test 35 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinputx 'fox' 
./testdata) >>testtry
  -echo "RC=$?" >>testtry
  +     echo "---------------------------- Test 34 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -s 'fox' ./testdata/grepnonexist) 
>>testtry 2>&1
  +     echo "RC=$?" >>testtry
   
  -echo "---------------------------- Test 36 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinput --exclude 
'grepinput$' 'fox' ./testdata | sort) >>testtry
  -echo "RC=$?" >>testtry
  +     echo "---------------------------- Test 35 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -L -r --include=grepinputx 'fox' 
./testdata) >>testtry
  +     echo "RC=$?" >>testtry
   
  -echo "---------------------------- Test 37 -----------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep  '^(a+)*\d' ./testdata/grepinput) >>testtry 
2>teststderr
  -echo "RC=$?" >>testtry
  -echo "======== STDERR ========" >>testtry
  -cat teststderr >>testtry
  +     echo "---------------------------- Test 36 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -L -r --include=grepinput --exclude 
'grepinput$' 'fox' ./testdata | sort) >>testtry
  +     echo "RC=$?" >>testtry
   
  -echo "---------------------------- Test 38 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep '>\x00<' ./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 37 
-----------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep  '^(a+)*\d' ./testdata/grepinput) 
>>testtry 2>teststderr
  +     echo "RC=$?" >>testtry
  +     echo "======== STDERR ========" >>testtry
  +     cat teststderr >>testtry
   
  -echo "---------------------------- Test 39 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -A1 'before the binary zero' 
./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 38 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep '>\x00<' ./testdata/grepinput) 
>>testtry
   
  -echo "---------------------------- Test 40 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -B1 'after the binary zero' 
./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 39 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -A1 'before the binary zero' 
./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 41 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -B1 -o '\w+ the binary zero' 
./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 40 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -B1 'after the binary zero' 
./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 41 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -B1 -onH '\w+ the binary zero' 
./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 41 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -B1 -o '\w+ the binary zero' 
./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 42 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -on 'before|zero|after' 
./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 41 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -B1 -onH '\w+ the binary zero' 
./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 43 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -on -e before -e zero -e after 
./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 42 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -on 'before|zero|after' 
./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 44 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -on -f ./testdata/greplist -e binary 
./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 43 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -on -e before -e zero -e after 
./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 45 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -e abc -e '(unclosed' ./testdata/grepinput) 
2>>testtry >>testtry
  +     echo "---------------------------- Test 44 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -on -f ./testdata/greplist -e binary 
./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 46 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -Fx "AB.VE
  -elephant" ./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 45 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -e abc -e '(unclosed' 
./testdata/grepinput) 2>>testtry >>testtry
   
  -echo "---------------------------- Test 47 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -F "AB.VE
  -elephant" ./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 46 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -Fx "AB.VE
  +     elephant" ./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 48 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -F -e DATA -e "AB.VE
  -elephant" ./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 47 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -F "AB.VE
  +     elephant" ./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 49 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep "^(abc|def|ghi|jkl)" ./testdata/grepinputx) 
>>testtry
  +     echo "---------------------------- Test 48 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -F -e DATA -e "AB.VE
  +     elephant" ./testdata/grepinput) >>testtry
   
  -echo "---------------------------- Test 50 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep -Mv "brown\sfox" ./testdata/grepinputv) 
>>testtry
  +     echo "---------------------------- Test 49 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep "^(abc|def|ghi|jkl)" 
./testdata/grepinputx) >>testtry
   
  -echo "---------------------------- Test 51 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep --colour=always jumps 
./testdata/grepinputv) >>testtry
  +     echo "---------------------------- Test 50 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep -Mv "brown\sfox" 
./testdata/grepinputv) >>testtry
   
  -echo "---------------------------- Test 52 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep --file-offsets 'before|zero|after' 
./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 51 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep --colour=always jumps 
./testdata/grepinputv) >>testtry
   
  -echo "---------------------------- Test 53 ------------------------------" 
>>testtry
  -(cd $srcdir; $valgrind $pcregrep --line-offsets 'before|zero|after' 
./testdata/grepinput) >>testtry
  +     echo "---------------------------- Test 52 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep --file-offsets 'before|zero|after' 
./testdata/grepinput) >>testtry
   
  -# Now compare the results.
  +     echo "---------------------------- Test 53 
------------------------------" >>testtry
  +     (cd $srcdir; $valgrind $pcregrep --line-offsets 'before|zero|after' 
./testdata/grepinput) >>testtry
   
  -$cf $srcdir/testdata/grepoutput testtry
  -if [ $? != 0 ] ; then exit 1; fi
  +     # Now compare the results.
   
  +     $cf $srcdir/testdata/grepoutput testtry
  +     if [ $? != 0 ] ; then exit 1; fi
   
  -# These tests require UTF-8 support
   
  -if [ $utf8 -ne 0 ] ; then
  -  echo "Testing pcregrep UTF-8 features"
  +     # These tests require UTF-8 support
   
  -  echo "---------------------------- Test U1 ------------------------------" 
>testtry
  -  (cd $srcdir; $valgrind $pcregrep -n -u --newline=any "^X" 
./testdata/grepinput8) >>testtry
  +     if [ $utf8 -ne 0 ] ; then
  +             echo "Testing pcregrep UTF-8 features"
   
  -  echo "---------------------------- Test U2 ------------------------------" 
>>testtry
  -  (cd $srcdir; $valgrind $pcregrep -n -u -C 3 --newline=any "Match" 
./testdata/grepinput8) >>testtry
  +             echo "---------------------------- Test U1 
------------------------------" >testtry
  +             (cd $srcdir; $valgrind $pcregrep -n -u --newline=any "^X" 
./testdata/grepinput8) >>testtry
   
  -  $cf $srcdir/testdata/grepoutput8 testtry
  -  if [ $? != 0 ] ; then exit 1; fi
  +             echo "---------------------------- Test U2 
------------------------------" >>testtry
  +             (cd $srcdir; $valgrind $pcregrep -n -u -C 3 --newline=any 
"Match" ./testdata/grepinput8) >>testtry
   
  -else
  -  echo "Skipping pcregrep UTF-8 tests: no UTF-8 support in PCRE library"
  -fi
  +             $cf $srcdir/testdata/grepoutput8 testtry
  +             if [ $? != 0 ] ; then exit 1; fi
  +
  +     else
  +             echo "Skipping pcregrep UTF-8 tests: no UTF-8 support in PCRE 
library"
  +     fi
  +
  +
  +     # We go to some contortions to try to ensure that the tests for the 
various
  +     # newline settings will work in environments where the normal newline 
sequence
  +     # is not \n. Do not use exported files, whose line endings might be 
changed.
  +     # Instead, create an input file using printf so that its contents are 
exactly
  +     # what we want. Note the messy fudge to get printf to write a string 
that
  +     # starts with a hyphen.
   
  +     echo "Testing pcregrep newline settings"
  +     printf "abc\rdef\r\nghi\njkl" >testNinput
   
  -# We go to some contortions to try to ensure that the tests for the various
  -# newline settings will work in environments where the normal newline 
sequence
  -# is not \n. Do not use exported files, whose line endings might be changed.
  -# Instead, create an input file using printf so that its contents are exactly
  -# what we want. Note the messy fudge to get printf to write a string that
  -# starts with a hyphen.
  -
  -echo "Testing pcregrep newline settings"
  -printf "abc\rdef\r\nghi\njkl" >testNinput
  -
  -printf "%c--------------------------- Test N1 
------------------------------\r\n" - >testtry
  -$valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput >>testtry
  -
  -printf "%c--------------------------- Test N2 
------------------------------\r\n" - >>testtry
  -$valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput 
>>testtry
  -
  -printf "%c--------------------------- Test N3 
------------------------------\r\n" - >>testtry
  -pattern=`printf 'def\rjkl'`
  -$valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry
  -
  -printf "%c--------------------------- Test N4 
------------------------------\r\n" - >>testtry
  -pattern=`printf 'xxx\r\njkl'`
  -$valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput >>testtry
  +     printf "%c--------------------------- Test N1 
------------------------------\r\n" - >testtry
  +     $valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput >>testtry
   
  -printf "%c--------------------------- Test N5 
------------------------------\r\n" - >>testtry
  -$valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput 
>>testtry
  +     printf "%c--------------------------- Test N2 
------------------------------\r\n" - >>testtry
  +     $valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput 
>>testtry
   
  -printf "%c--------------------------- Test N6 
------------------------------\r\n" - >>testtry
  -$valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinput 
>>testtry
  +     printf "%c--------------------------- Test N3 
------------------------------\r\n" - >>testtry
  +     pattern=`printf 'def\rjkl'`
  +     $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry
   
  -$cf $srcdir/testdata/grepoutputN testtry
  -if [ $? != 0 ] ; then exit 1; fi
  +     printf "%c--------------------------- Test N4 
------------------------------\r\n" - >>testtry
  +     pattern=`printf 'xxx\r\njkl'`
  +     $valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput >>testtry
  +
  +     printf "%c--------------------------- Test N5 
------------------------------\r\n" - >>testtry
  +     $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput 
>>testtry
  +
  +     printf "%c--------------------------- Test N6 
------------------------------\r\n" - >>testtry
  +     $valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" 
testNinput >>testtry
  +
  +     $cf $srcdir/testdata/grepoutputN testtry
  +     if [ $? != 0 ] ; then exit 1; fi
  +
  +else
  +      echo "Skipping rpmgrep tests: $pcregrep built without PCRE support"
  +fi
   
   exit 0
   
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to