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

Diff of /code/trunk/RunGrepTest

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

revision 87 by nigel, Sat Feb 24 21:41:21 2007 UTC revision 116 by ph10, Fri Mar 9 15:23:02 2007 UTC
# Line 3  Line 3 
3  # This file is generated by configure from RunGrepTest.in. Make any changes  # This file is generated by configure from RunGrepTest.in. Make any changes
4  # to that file.  # to that file.
5    
6    # Set the C locale, so that sort(1) behaves predictably.
7    LC_ALL=C
8    export LC_ALL
9    
10  echo "Testing pcregrep"  echo "Testing pcregrep"
11  ./pcregrep -V  ./pcregrep -V
12    
# Line 10  echo "Testing pcregrep" Line 14  echo "Testing pcregrep"
14  # 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
15  # supported by pcregrep.  # supported by pcregrep.
16    
17  cf=diff  cf="diff -u"
18  valgrind=  valgrind=
19  if [ ! -d testdata ] ; then  if [ ! -d testdata ] ; then
20    ln -s @top_srcdir@/testdata testdata    ln -s @top_srcdir@/testdata testdata
# Line 19  testdata=./testdata Line 23  testdata=./testdata
23    
24  while [ $# -gt 0 ] ; do  while [ $# -gt 0 ] ; do
25    case $1 in    case $1 in
26      valgrind) valgrind="valgrind -q --leak-check=no";;      valgrind) valgrind="valgrind -q --leak-check=no";;
27      *) echo "Unknown argument $1"; exit 1;;      *) echo "Unknown argument $1"; exit 1;;
28    esac    esac
29    shift    shift
30  done  done
31    
32    # Check for the availability of UTF-8 support
33    
34    ./pcretest -C | ./pcregrep "No UTF-8 support" >/dev/null
35    utf8=$?
36    
37  echo "---------------------------- Test 1 ------------------------------" >testtry  echo "---------------------------- Test 1 ------------------------------" >testtry
38  $valgrind ./pcregrep PATTERN $testdata/grepinput >>testtry  $valgrind ./pcregrep PATTERN $testdata/grepinput >>testtry
39    
# Line 124  echo "---------------------------- Test Line 133  echo "---------------------------- Test
133  $valgrind ./pcregrep -L 'fox' $testdata/grepinput $testdata/grepinputx >>testtry  $valgrind ./pcregrep -L 'fox' $testdata/grepinput $testdata/grepinputx >>testtry
134    
135  echo "---------------------------- Test 33 -----------------------------" >>testtry  echo "---------------------------- Test 33 -----------------------------" >>testtry
136  $valgrind ./pcregrep 'fox' $testdata/grepnonexist >>testtry 2>&1  $valgrind ./pcregrep 'fox' $testdata/grepnonexist >>testtry 2>&1
137  echo "RC=$?" >>testtry  echo "RC=$?" >>testtry
138    
139  echo "---------------------------- Test 34 -----------------------------" >>testtry  echo "---------------------------- Test 34 -----------------------------" >>testtry
140  $valgrind ./pcregrep -s 'fox' $testdata/grepnonexist >>testtry 2>&1  $valgrind ./pcregrep -s 'fox' $testdata/grepnonexist >>testtry 2>&1
141  echo "RC=$?" >>testtry  echo "RC=$?" >>testtry
142    
143  echo "---------------------------- Test 35 -----------------------------" >>testtry  echo "---------------------------- Test 35 -----------------------------" >>testtry
144  $valgrind ./pcregrep -L -r --include=grepinputx 'fox' $testdata >>testtry  $valgrind ./pcregrep -L -r --include=grepinputx 'fox' $testdata >>testtry
145  echo "RC=$?" >>testtry  echo "RC=$?" >>testtry
146    
147  echo "---------------------------- Test 36 -----------------------------" >>testtry  echo "---------------------------- Test 36 -----------------------------" >>testtry
148  $valgrind ./pcregrep -L -r --include=grepinput --exclude 'grepinput$' 'fox' $testdata >>testtry  $valgrind ./pcregrep -L -r --include=grepinput --exclude 'grepinput$' 'fox' $testdata | sort >>testtry
149  echo "RC=$?" >>testtry  echo "RC=$?" >>testtry
150    
151  echo "---------------------------- Test 37 -----------------------------" >>testtry  echo "---------------------------- Test 37 -----------------------------" >>testtry
# Line 184  echo "---------------------------- Test Line 193  echo "---------------------------- Test
193  $valgrind ./pcregrep -F -e DATA -e "AB.VE  $valgrind ./pcregrep -F -e DATA -e "AB.VE
194  elephant" $testdata/grepinput >>testtry  elephant" $testdata/grepinput >>testtry
195    
196    echo "---------------------------- Test 49 ------------------------------" >>testtry
197    $valgrind ./pcregrep "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
198    
199    echo "---------------------------- Test 50 ------------------------------" >>testtry
200    $valgrind ./pcregrep -N CR "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
201    
202    echo "---------------------------- Test 51 ------------------------------" >>testtry
203    $valgrind ./pcregrep --newline=crlf "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
204    
205    echo "---------------------------- Test 52 ------------------------------" >>testtry
206    pattern=`printf 'def\rjkl'`
207    $valgrind ./pcregrep --newline=cr -F "$pattern" $testdata/grepinputx >>testtry
208    
209    echo "---------------------------- Test 53 ------------------------------" >>testtry
210    pattern=`printf 'xxx\r\njkl'`
211    $valgrind ./pcregrep --newline=crlf -F "$pattern" $testdata/grepinputx >>testtry
212    
213    echo "---------------------------- Test 54 ------------------------------" >>testtry
214    $valgrind ./pcregrep -n --newline=any "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
215    
216  # Now compare the results.  # Now compare the results.
217    
218  $cf testtry $testdata/grepoutput  $cf testtry $testdata/grepoutput
219  if [ $? != 0 ] ; then exit 1; else exit 0; fi  if [ $? != 0 ] ; then exit 1; fi
220    
221    # These tests require UTF-8 support
222    
223    if [ $utf8 -ne 0 ] ; then
224      echo "Testing pcregrep UTF-8 features"
225    
226      echo "---------------------------- Test U1 ------------------------------" >testtry
227      $valgrind ./pcregrep -n -u --newline=any "^X" $testdata/grepinput8 >>testtry
228    
229      echo "---------------------------- Test U2 ------------------------------" >>testtry
230      $valgrind ./pcregrep -n -u -C 3 --newline=any "Match" $testdata/grepinput8 >>testtry
231    
232      $cf testtry $testdata/grepoutput8
233      if [ $? != 0 ] ; then exit 1; fi
234    
235    else
236      echo "Skipping pcregrep UTF-8 tests: no UTF-8 support in PCRE library"
237    fi
238    
239    exit 0
240    
241  # End  # End

Legend:
Removed from v.87  
changed lines
  Added in v.116

  ViewVC Help
Powered by ViewVC 1.1.5