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

Diff of /code/trunk/RunGrepTest

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

code/trunk/RunGrepTest.in revision 128 by ph10, Tue Mar 20 11:46:50 2007 UTC code/trunk/RunGrepTest revision 137 by ph10, Thu Mar 29 13:56:00 2007 UTC
# Line 15  echo "Testing pcregrep" Line 15  echo "Testing pcregrep"
15  # itself. What we are checking here is the file handling and options that are  # itself. What we are checking here is the file handling and options that are
16  # supported by pcregrep.  # supported by pcregrep.
17    
18  cf="diff -u"  cf="diff -ub"
19  valgrind=  valgrind=
20  if [ ! -d testdata ] ; then  testdata=testdata
21    ln -s @top_srcdir@/testdata testdata  
22    if [ -n "$srcdir" -a -d "$srcdir/testdata" ] ; then
23      testdata="$srcdir/testdata"
24  fi  fi
 testdata=./testdata  
25    
26  while [ $# -gt 0 ] ; do  while [ $# -gt 0 ] ; do
27    case $1 in    case $1 in
# Line 197  elephant" $testdata/grepinput >>testtry Line 198  elephant" $testdata/grepinput >>testtry
198  echo "---------------------------- Test 49 ------------------------------" >>testtry  echo "---------------------------- Test 49 ------------------------------" >>testtry
199  $valgrind ./pcregrep "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry  $valgrind ./pcregrep "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
200    
 echo "---------------------------- Test 50 ------------------------------" >>testtry  
 $valgrind ./pcregrep -N CR "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry  
   
 echo "---------------------------- Test 51 ------------------------------" >>testtry  
 $valgrind ./pcregrep --newline=crlf "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry  
   
 echo "---------------------------- Test 52 ------------------------------" >>testtry  
 pattern=`printf 'def\rjkl'`  
 $valgrind ./pcregrep --newline=cr -F "$pattern" $testdata/grepinputx >>testtry  
   
 echo "---------------------------- Test 53 ------------------------------" >>testtry  
 pattern=`printf 'xxx\r\njkl'`  
 $valgrind ./pcregrep --newline=crlf -F "$pattern" $testdata/grepinputx >>testtry  
   
 echo "---------------------------- Test 54 ------------------------------" >>testtry  
 $valgrind ./pcregrep -n --newline=any "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry  
   
201  # Now compare the results.  # Now compare the results.
202    
203  $cf testtry $testdata/grepoutput  $cf testtry $testdata/grepoutput
204  if [ $? != 0 ] ; then exit 1; fi  if [ $? != 0 ] ; then exit 1; fi
205    
206    
207  # These tests require UTF-8 support  # These tests require UTF-8 support
208    
209  if [ $utf8 -ne 0 ] ; then  if [ $utf8 -ne 0 ] ; then
# Line 237  else Line 222  else
222    echo "Skipping pcregrep UTF-8 tests: no UTF-8 support in PCRE library"    echo "Skipping pcregrep UTF-8 tests: no UTF-8 support in PCRE library"
223  fi  fi
224    
225    
226    # The tests for various newline values may not work in environments where
227    # the newlines in the files are not \n.
228    
229    echo "Testing pcregrep newline settings"
230    
231    echo "---------------------------- Test N1 ------------------------------" >testtry
232    $valgrind ./pcregrep -N CR "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
233    
234    echo "---------------------------- Test N2 ------------------------------" >>testtry
235    $valgrind ./pcregrep --newline=crlf "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
236    
237    echo "---------------------------- Test N3 ------------------------------" >>testtry
238    pattern=`printf 'def\rjkl'`
239    $valgrind ./pcregrep --newline=cr -F "$pattern" $testdata/grepinputx >>testtry
240    
241    echo "---------------------------- Test n$ ------------------------------" >>testtry
242    pattern=`printf 'xxx\r\njkl'`
243    $valgrind ./pcregrep --newline=crlf -F "$pattern" $testdata/grepinputx >>testtry
244    
245    echo "---------------------------- Test N5 ------------------------------" >>testtry
246    $valgrind ./pcregrep -n --newline=any "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
247    
248    $cf testtry $testdata/grepoutputN
249    if [ $? != 0 ] ; then exit 1; fi
250    
251  exit 0  exit 0
252    
253  # End  # End

Legend:
Removed from v.128  
changed lines
  Added in v.137

  ViewVC Help
Powered by ViewVC 1.1.5