/[pcre]/code/trunk/RunGrepTest
ViewVC logotype

Diff of /code/trunk/RunGrepTest

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 142 by ph10, Fri Mar 30 15:55:18 2007 UTC revision 378 by ph10, Sun Mar 1 14:13:34 2009 UTC
# Line 147  echo "---------------------------- Test Line 147  echo "---------------------------- Test
147  echo "RC=$?" >>testtry  echo "RC=$?" >>testtry
148    
149  echo "---------------------------- Test 35 -----------------------------" >>testtry  echo "---------------------------- Test 35 -----------------------------" >>testtry
150  (cd $srcdir; $valgrind $pcregrep -L -r --include=grepinputx 'fox' ./testdata) >>testtry  (cd $srcdir; $valgrind $pcregrep -L -r --include=grepinputx --exclude_dir='^\.' 'fox' ./testdata) >>testtry
151  echo "RC=$?" >>testtry  echo "RC=$?" >>testtry
152    
153  echo "---------------------------- Test 36 -----------------------------" >>testtry  echo "---------------------------- Test 36 -----------------------------" >>testtry
154  (cd $srcdir; $valgrind $pcregrep -L -r --include=grepinput --exclude 'grepinput$' 'fox' ./testdata | sort) >>testtry  (cd $srcdir; $valgrind $pcregrep -L -r --include=grepinput --exclude 'grepinput$' --exclude_dir='^\.' 'fox' ./testdata | sort) >>testtry
155  echo "RC=$?" >>testtry  echo "RC=$?" >>testtry
156    
157  echo "---------------------------- Test 37 -----------------------------" >>testtry  echo "---------------------------- Test 37 -----------------------------" >>testtry
# Line 202  elephant" ./testdata/grepinput) >>testtr Line 202  elephant" ./testdata/grepinput) >>testtr
202  echo "---------------------------- Test 49 ------------------------------" >>testtry  echo "---------------------------- Test 49 ------------------------------" >>testtry
203  (cd $srcdir; $valgrind $pcregrep "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry  (cd $srcdir; $valgrind $pcregrep "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry
204    
205    echo "---------------------------- Test 50 ------------------------------" >>testtry
206    (cd $srcdir; $valgrind $pcregrep -Mv "brown\sfox" ./testdata/grepinputv) >>testtry
207    
208    echo "---------------------------- Test 51 ------------------------------" >>testtry
209    (cd $srcdir; $valgrind $pcregrep --colour=always jumps ./testdata/grepinputv) >>testtry
210    
211    echo "---------------------------- Test 52 ------------------------------" >>testtry
212    (cd $srcdir; $valgrind $pcregrep --file-offsets 'before|zero|after' ./testdata/grepinput) >>testtry
213    
214    echo "---------------------------- Test 53 ------------------------------" >>testtry
215    (cd $srcdir; $valgrind $pcregrep --line-offsets 'before|zero|after' ./testdata/grepinput) >>testtry
216    
217    echo "---------------------------- Test 54 -----------------------------" >>testtry
218    (cd $srcdir; $valgrind $pcregrep -f./testdata/greplist --color=always ./testdata/grepinputx) >>testtry
219    
220  # Now compare the results.  # Now compare the results.
221    
222  $cf testtry $srcdir/testdata/grepoutput  $cf $srcdir/testdata/grepoutput testtry
223  if [ $? != 0 ] ; then exit 1; fi  if [ $? != 0 ] ; then exit 1; fi
224    
225    
# Line 219  if [ $utf8 -ne 0 ] ; then Line 234  if [ $utf8 -ne 0 ] ; then
234    echo "---------------------------- Test U2 ------------------------------" >>testtry    echo "---------------------------- Test U2 ------------------------------" >>testtry
235    (cd $srcdir; $valgrind $pcregrep -n -u -C 3 --newline=any "Match" ./testdata/grepinput8) >>testtry    (cd $srcdir; $valgrind $pcregrep -n -u -C 3 --newline=any "Match" ./testdata/grepinput8) >>testtry
236    
237    $cf testtry $srcdir/testdata/grepoutput8    $cf $srcdir/testdata/grepoutput8 testtry
238    if [ $? != 0 ] ; then exit 1; fi    if [ $? != 0 ] ; then exit 1; fi
239    
240  else  else
# Line 227  else Line 242  else
242  fi  fi
243    
244    
245  # The tests for various newline values may not work in environments where  # We go to some contortions to try to ensure that the tests for the various
246  # the newlines in the files are not \n.  # newline settings will work in environments where the normal newline sequence
247    # is not \n. Do not use exported files, whose line endings might be changed.
248    # Instead, create an input file using printf so that its contents are exactly
249    # what we want. Note the messy fudge to get printf to write a string that
250    # starts with a hyphen.
251    
252  echo "Testing pcregrep newline settings"  echo "Testing pcregrep newline settings"
253    printf "abc\rdef\r\nghi\njkl" >testNinput
254    
255  echo "---------------------------- Test N1 ------------------------------" >testtry  printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtry
256  (cd $srcdir; $valgrind $pcregrep -N CR "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput >>testtry
257    
258  echo "---------------------------- Test N2 ------------------------------" >>testtry  printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtry
259  (cd $srcdir; $valgrind $pcregrep --newline=crlf "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput >>testtry
260    
261  echo "---------------------------- Test N3 ------------------------------" >>testtry  printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtry
262  pattern=`printf 'def\rjkl'`  pattern=`printf 'def\rjkl'`
263  (cd $srcdir; $valgrind $pcregrep --newline=cr -F "$pattern" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry
264    
265  echo "---------------------------- Test n$ ------------------------------" >>testtry  printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtry
266  pattern=`printf 'xxx\r\njkl'`  pattern=`printf 'xxx\r\njkl'`
267  (cd $srcdir; $valgrind $pcregrep --newline=crlf -F "$pattern" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput >>testtry
268    
269    printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry
270    $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput >>testtry
271    
272  echo "---------------------------- Test N5 ------------------------------" >>testtry  printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtry
273  (cd $srcdir; $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinput >>testtry
274    
275  $cf testtry $srcdir/testdata/grepoutputN  $cf $srcdir/testdata/grepoutputN testtry
276  if [ $? != 0 ] ; then exit 1; fi  if [ $? != 0 ] ; then exit 1; fi
277    
278  exit 0  exit 0

Legend:
Removed from v.142  
changed lines
  Added in v.378

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12