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

Diff of /code/trunk/RunGrepTest

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

revision 138 by ph10, Thu Mar 29 15:20:15 2007 UTC revision 420 by ph10, Wed Aug 12 17:32:27 2009 UTC
# Line 33  done Line 33  done
33    
34  if [ -z "$srcdir" -o ! -d "$srcdir/testdata" ] ; then  if [ -z "$srcdir" -o ! -d "$srcdir/testdata" ] ; then
35    srcdir=.    srcdir=.
36  fi  fi
37    
38  # Check for the availability of UTF-8 support  # Check for the availability of UTF-8 support
39    
# 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    echo "---------------------------- Test 55 -----------------------------" >>testtry
221    (cd $srcdir; $valgrind $pcregrep -c lazy ./testdata/grepinput*) >>testtry
222    
223    echo "---------------------------- Test 56 -----------------------------" >>testtry
224    (cd $srcdir; $valgrind $pcregrep -c -l lazy ./testdata/grepinput*) >>testtry
225    
226  # Now compare the results.  # Now compare the results.
227    
228  $cf testtry $srcdir/testdata/grepoutput  $cf $srcdir/testdata/grepoutput testtry
229  if [ $? != 0 ] ; then exit 1; fi  if [ $? != 0 ] ; then exit 1; fi
230    
231    
# Line 219  if [ $utf8 -ne 0 ] ; then Line 240  if [ $utf8 -ne 0 ] ; then
240    echo "---------------------------- Test U2 ------------------------------" >>testtry    echo "---------------------------- Test U2 ------------------------------" >>testtry
241    (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
242    
243    $cf testtry $srcdir/testdata/grepoutput8    $cf $srcdir/testdata/grepoutput8 testtry
244    if [ $? != 0 ] ; then exit 1; fi    if [ $? != 0 ] ; then exit 1; fi
245    
246  else  else
# Line 227  else Line 248  else
248  fi  fi
249    
250    
251  # 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
252  # the newlines in the files are not \n.  # newline settings will work in environments where the normal newline sequence
253    # is not \n. Do not use exported files, whose line endings might be changed.
254    # Instead, create an input file using printf so that its contents are exactly
255    # what we want. Note the messy fudge to get printf to write a string that
256    # starts with a hyphen.
257    
258  echo "Testing pcregrep newline settings"  echo "Testing pcregrep newline settings"
259    printf "abc\rdef\r\nghi\njkl" >testNinput
260    
261  echo "---------------------------- Test N1 ------------------------------" >testtry  printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtry
262  (cd $srcdir; $valgrind $pcregrep -N CR "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput >>testtry
263    
264  echo "---------------------------- Test N2 ------------------------------" >>testtry  printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtry
265  (cd $srcdir; $valgrind $pcregrep --newline=crlf "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput >>testtry
266    
267  echo "---------------------------- Test N3 ------------------------------" >>testtry  printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtry
268  pattern=`printf 'def\rjkl'`  pattern=`printf 'def\rjkl'`
269  (cd $srcdir; $valgrind $pcregrep --newline=cr -F "$pattern" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry
270    
271  echo "---------------------------- Test n$ ------------------------------" >>testtry  printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtry
272  pattern=`printf 'xxx\r\njkl'`  pattern=`printf 'xxx\r\njkl'`
273  (cd $srcdir; $valgrind $pcregrep --newline=crlf -F "$pattern" ./testdata/grepinputx) >>testtry  $valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput >>testtry
274    
275    printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry
276    $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput >>testtry
277    
278  echo "---------------------------- Test N5 ------------------------------" >>testtry  printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtry
279  (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
280    
281  $cf testtry $srcdir/testdata/grepoutputN  $cf $srcdir/testdata/grepoutputN testtry
282  if [ $? != 0 ] ; then exit 1; fi  if [ $? != 0 ] ; then exit 1; fi
283    
284  exit 0  exit 0

Legend:
Removed from v.138  
changed lines
  Added in v.420

  ViewVC Help
Powered by ViewVC 1.1.5