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

Diff of /code/trunk/RunGrepTest

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

revision 130 by ph10, Tue Mar 20 11:46:50 2007 UTC revision 131 by ph10, Mon Mar 26 15:10:12 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  if [ ! -d testdata ] ; then
21    ln -s @top_srcdir@/testdata testdata    ln -s @top_srcdir@/testdata testdata
# Line 197  elephant" $testdata/grepinput >>testtry Line 197  elephant" $testdata/grepinput >>testtry
197  echo "---------------------------- Test 49 ------------------------------" >>testtry  echo "---------------------------- Test 49 ------------------------------" >>testtry
198  $valgrind ./pcregrep "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry  $valgrind ./pcregrep "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
199    
 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  
   
200  # Now compare the results.  # Now compare the results.
201    
202  $cf testtry $testdata/grepoutput  $cf testtry $testdata/grepoutput
203  if [ $? != 0 ] ; then exit 1; fi  if [ $? != 0 ] ; then exit 1; fi
204    
205    
206  # These tests require UTF-8 support  # These tests require UTF-8 support
207    
208  if [ $utf8 -ne 0 ] ; then  if [ $utf8 -ne 0 ] ; then
# Line 237  else Line 221  else
221    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"
222  fi  fi
223    
224    
225    # The tests for various newline values may not work in environments where
226    # the newlines in the files are not \n.
227    
228    echo "Testing pcregrep newline settings"
229    
230    echo "---------------------------- Test N1 ------------------------------" >testtry
231    $valgrind ./pcregrep -N CR "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
232    
233    echo "---------------------------- Test N2 ------------------------------" >>testtry
234    $valgrind ./pcregrep --newline=crlf "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
235    
236    echo "---------------------------- Test N3 ------------------------------" >>testtry
237    pattern=`printf 'def\rjkl'`
238    $valgrind ./pcregrep --newline=cr -F "$pattern" $testdata/grepinputx >>testtry
239    
240    echo "---------------------------- Test n$ ------------------------------" >>testtry
241    pattern=`printf 'xxx\r\njkl'`
242    $valgrind ./pcregrep --newline=crlf -F "$pattern" $testdata/grepinputx >>testtry
243    
244    echo "---------------------------- Test N5 ------------------------------" >>testtry
245    $valgrind ./pcregrep -n --newline=any "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
246    
247    $cf testtry $testdata/grepoutputN
248    if [ $? != 0 ] ; then exit 1; fi
249    
250  exit 0  exit 0
251    
252  # End  # End

Legend:
Removed from v.130  
changed lines
  Added in v.131

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12