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

Diff of /code/trunk/RunGrepTest

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

revision 711 by ph10, Sun Sep 25 11:04:33 2011 UTC revision 842 by ph10, Sat Dec 31 15:19:04 2011 UTC
# Line 5  Line 5 
5  # supported by pcregrep.  # supported by pcregrep.
6    
7  # Set the C locale, so that sort(1) behaves predictably.  # Set the C locale, so that sort(1) behaves predictably.
8    
9  LC_ALL=C  LC_ALL=C
10  export LC_ALL  export LC_ALL
11    
12    # Remove any non-default colouring and aliases that the caller may have set.
13    
14    unset PCREGREP_COLOUR PCREGREP_COLOR
15    unset cp ls mv rm
16    
17    # Set the program to be tested, and valgrind settings when requested.
18    
19  pcregrep=`pwd`/pcregrep  pcregrep=`pwd`/pcregrep
20    
21  valgrind=  valgrind=
# Line 28  fi Line 36  fi
36    
37  $pcregrep -V  $pcregrep -V
38    
 cf="diff -ub"  
   
39  # Set up a suitable "diff" command for comparison. Some systems have a diff  # Set up a suitable "diff" command for comparison. Some systems have a diff
40  # that lacks a -u option. Try to deal with this; better do the test for the -b  # that lacks a -u option. Try to deal with this; better do the test for the -b
41  # option as well.  # option as well.
42    
43    cf="diff -ub"
44  if diff -u /dev/null /dev/null; then  if diff -u /dev/null /dev/null; then
45    if diff -ub /dev/null /dev/null; then cf="diff -ub"; else cf="diff -u"; fi    if diff -ub /dev/null /dev/null; then cf="diff -ub"; else cf="diff -u"; fi
46  else  else
# Line 55  if [ -z "$srcdir" -o ! -d "$srcdir/testd Line 62  if [ -z "$srcdir" -o ! -d "$srcdir/testd
62    else    else
63      echo "Cannot find the testdata directory"      echo "Cannot find the testdata directory"
64      exit 1      exit 1
65    fi    fi
66  fi  fi
67    
68  # Check for the availability of UTF-8 support  # Check for the availability of UTF-8 support
69    
70  ./pcretest -C | ./pcregrep "No UTF-8 support" >/dev/null  ./pcretest -C utf >/dev/null
71  utf8=$?  utf8=$?
72    
73  echo "---------------------------- Test 1 ------------------------------" >testtry  echo "---------------------------- Test 1 ------------------------------" >testtry
# Line 448  pattern=`printf 'def\rjkl'` Line 455  pattern=`printf 'def\rjkl'`
455  $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry  $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry
456    
457  printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtry
458  pattern=`printf 'xxx\r\njkl'`  $valgrind $pcregrep -n --newline=crlf -F -f $srcdir/testdata/greppatN4 testNinput >>testtry
 $valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput >>testtry  
459    
460  printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry  printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry
461  $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput >>testtry  $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput >>testtry

Legend:
Removed from v.711  
changed lines
  Added in v.842

  ViewVC Help
Powered by ViewVC 1.1.5