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

Diff of /code/trunk/RunTest

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

revision 162 by ph10, Thu May 3 10:47:48 2007 UTC revision 371 by ph10, Mon Aug 25 18:28:05 2008 UTC
# Line 1  Line 1 
1  #! /bin/sh  #! /bin/sh
2    
3  # Run PCRE tests  # Run PCRE tests.
4    
 cf="diff -u"  
5  valgrind=  valgrind=
 testdata=testdata  
6    
7    # Set up a suitable "diff" command for comparison. Some systems
8    # have a diff that lacks a -u option. Try to deal with this.
9    
10    if diff -u /dev/null /dev/null; then cf="diff -u"; else cf="diff"; fi
11    
12    # Find the test data
13    
14    testdata=testdata
15  if [ -n "$srcdir" -a -d "$srcdir" ] ; then  if [ -n "$srcdir" -a -d "$srcdir" ] ; then
16    testdata="$srcdir/testdata"    testdata="$srcdir/testdata"
17  fi  fi
# Line 37  do6=no Line 43  do6=no
43  do7=no  do7=no
44  do8=no  do8=no
45  do9=no  do9=no
46    do10=no
47    
48  while [ $# -gt 0 ] ; do  while [ $# -gt 0 ] ; do
49    case $1 in    case $1 in
# Line 49  while [ $# -gt 0 ] ; do Line 56  while [ $# -gt 0 ] ; do
56      7) do7=yes;;      7) do7=yes;;
57      8) do8=yes;;      8) do8=yes;;
58      9) do9=yes;;      9) do9=yes;;
59      valgrind) valgrind="valgrind -q";;     10) do10=yes;;
60       valgrind) valgrind="valgrind -q";;
61      *) echo "Unknown test number $1"; exit 1;;      *) echo "Unknown test number $1"; exit 1;;
62    esac    esac
63    shift    shift
# Line 64  if [ $utf8 -eq 0 ] ; then Line 72  if [ $utf8 -eq 0 ] ; then
72      echo "Can't run test 5 because UTF-8 support is not configured"      echo "Can't run test 5 because UTF-8 support is not configured"
73      exit 1      exit 1
74    fi    fi
   if [ $do6 = yes ] ; then  
     echo "Can't run test 6 because UTF-8 support is not configured"  
     exit 1  
   fi  
75    if [ $do8 = yes ] ; then    if [ $do8 = yes ] ; then
76      echo "Can't run test 8 because UTF-8 support is not configured"      echo "Can't run test 8 because UTF-8 support is not configured"
77      exit 1      exit 1
78    fi    fi
   if [ $do9 = yes ] ; then  
     echo "Can't run test 9 because UTF-8 support is not configured"  
     exit 1  
   fi  
79  fi  fi
80    
81  if [ $ucp -eq 0 ] ; then  if [ $ucp -eq 0 ] ; then
# Line 87  if [ $ucp -eq 0 ] ; then Line 87  if [ $ucp -eq 0 ] ; then
87      echo "Can't run test 9 because Unicode property support is not configured"      echo "Can't run test 9 because Unicode property support is not configured"
88      exit 1      exit 1
89    fi    fi
90      if [ $do10 = yes ] ; then
91        echo "Can't run test 10 because Unicode property support is not configured"
92        exit 1
93      fi
94    fi
95    
96    if [ $link_size -ne 2 ] ; then
97      if [ $do10 = yes ] ; then
98        echo "Can't run test 10 because the link size ($link_size) is not 2"
99        exit 1
100      fi
101  fi  fi
102    
103  # If no specific tests were requested, select all that are relevant.  # If no specific tests were requested, select all that are relevant.
104    
105  if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \  if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
106       $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \       $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \
107       $do9 = no ] ; then       $do9 = no -a $do10 = no ] ; then
108    do1=yes    do1=yes
109    do2=yes    do2=yes
110    do3=yes    do3=yes
# Line 103  if [ $do1 = no -a $do2 = no -a $do3 = no Line 114  if [ $do1 = no -a $do2 = no -a $do3 = no
114    do7=yes    do7=yes
115    if [ $utf8 -ne 0 ] ; then do8=yes; fi    if [ $utf8 -ne 0 ] ; then do8=yes; fi
116    if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do9=yes; fi    if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do9=yes; fi
117      if [ $link_size -eq 2 -a $ucp -ne 0 ] ; then do10=yes; fi
118  fi  fi
119    
120  # Show which release  # Show which release
# Line 132  if [ $do2 = yes ] ; then Line 144  if [ $do2 = yes ] ; then
144    if [ $? = 0 ] ; then    if [ $? = 0 ] ; then
145      $cf $testdata/testoutput2 testtry      $cf $testdata/testoutput2 testtry
146      if [ $? != 0 ] ; then exit 1; fi      if [ $? != 0 ] ; then exit 1; fi
147    else exit 1    else
148        echo " "
149        echo "** Test 2 requires a lot of stack. If it has crashed with a"
150        echo "** segmentation fault, it may be that you do not have enough"
151        echo "** stack available by default. Please see the 'pcrestack' man"
152        echo "** page for a discussion of PCRE's stack usage."
153        echo " "
154        exit 1
155    fi    fi
156    echo "OK"    echo "OK"
157  fi  fi
# Line 250  if [ $do9 = yes ] ; then Line 269  if [ $do9 = yes ] ; then
269      if [ $? != 0 ] ; then exit 1; fi      if [ $? != 0 ] ; then exit 1; fi
270    else exit 1    else exit 1
271    fi    fi
272      echo "OK"
273    fi
274    
275    # Test of internal offsets and code sizes. This test is run only when there
276    # is Unicode property support and the link size is 2. The actual tests are
277    # mostly the same as in some of the above, but in this test we inspect some
278    # offsets and sizes that require a known link size. This is a doublecheck for
279    # the maintainer, just in case something changes unexpectely.
280    
281    if [ $do10 = yes ] ; then
282      echo "Test 10: Internal offsets and code size tests"
283      $valgrind ./pcretest -q $testdata/testinput10 testtry
284      if [ $? = 0 ] ; then
285        $cf $testdata/testoutput10 testtry
286        if [ $? != 0 ] ; then exit 1; fi
287      else exit 1
288      fi
289    echo "OK"    echo "OK"
290  fi  fi
291    

Legend:
Removed from v.162  
changed lines
  Added in v.371

  ViewVC Help
Powered by ViewVC 1.1.5