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

Diff of /code/trunk/RunTest

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

code/trunk/RunTest.in revision 128 by ph10, Tue Mar 20 11:46:50 2007 UTC code/trunk/RunTest revision 161 by ph10, Thu May 3 10:28:07 2007 UTC
# Line 1  Line 1 
1  #! /bin/sh  #! /bin/sh
2    
 # This file is generated by configure from RunTest.in. Make any changes  
 # to that file.  
   
3  # Run PCRE tests  # Run PCRE tests
4    
5  cf=diff  cf="diff -u"
6  valgrind=  valgrind=
7  if [ ! -d testdata ] ; then  testdata=testdata
8    ln -s @top_srcdir@/testdata testdata  
9    if [ -n "$srcdir" -a -d "$srcdir" ] ; then
10      testdata="$srcdir/testdata"
11  fi  fi
 testdata=./testdata  
12    
13  # Find which optional facilities are available  # Find which optional facilities are available
14    
# Line 57  while [ $# -gt 0 ] ; do Line 55  while [ $# -gt 0 ] ; do
55    shift    shift
56  done  done
57    
 if [ "$link_size" != "2" ] ; then  
   if [ $do2 = yes ] ; then  
     echo "Can't run test 2 with an internal link size other than 2"  
     exit 1  
   fi  
   if [ $do5 = yes ] ; then  
     echo "Can't run test 5 with an internal link size other than 2"  
     exit 1  
   fi  
   if [ $do6 = yes ] ; then  
     echo "Can't run test 6 with an internal link size other than 2"  
     exit 1  
   fi  
 fi  
   
58  if [ $utf8 -eq 0 ] ; then  if [ $utf8 -eq 0 ] ; then
59    if [ $do4 = yes ] ; then    if [ $do4 = yes ] ; then
60      echo "Can't run test 4 because UTF-8 support is not configured"      echo "Can't run test 4 because UTF-8 support is not configured"
# Line 134  if [ $do1 = yes ] ; then Line 117  if [ $do1 = yes ] ; then
117    echo "Test 1: main functionality (Perl compatible)"    echo "Test 1: main functionality (Perl compatible)"
118    $valgrind ./pcretest -q $testdata/testinput1 testtry    $valgrind ./pcretest -q $testdata/testinput1 testtry
119    if [ $? = 0 ] ; then    if [ $? = 0 ] ; then
120      $cf testtry $testdata/testoutput1      $cf $testdata/testoutput1 testtry
121      if [ $? != 0 ] ; then exit 1; fi      if [ $? != 0 ] ; then exit 1; fi
122    else exit 1    else exit 1
123    fi    fi
# Line 148  if [ $do2 = yes ] ; then Line 131  if [ $do2 = yes ] ; then
131      echo "Test 2: API and error handling (not Perl compatible)"      echo "Test 2: API and error handling (not Perl compatible)"
132      $valgrind ./pcretest -q $testdata/testinput2 testtry      $valgrind ./pcretest -q $testdata/testinput2 testtry
133      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
134        $cf testtry $testdata/testoutput2        $cf $testdata/testoutput2 testtry
135        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
136      else exit 1      else exit 1
137      fi      fi
# Line 159  if [ $do2 = yes ] ; then Line 142  if [ $do2 = yes ] ; then
142    fi    fi
143  fi  fi
144    
145  # Locale-specific tests, provided the "fr_FR" locale is available  # Locale-specific tests, provided that either the "fr_FR" or the "french"
146    # locale is available. The former is the Unix-like standard; the latter is
147    # for Windows.
148    
149  if [ $do3 = yes ] ; then  if [ $do3 = yes ] ; then
150    locale -a | grep '^fr_FR$' >/dev/null    locale -a | grep '^fr_FR$' >/dev/null
151    if [ $? -eq 0 ] ; then    if [ $? -eq 0 ] ; then
152      echo "Test 3: locale-specific features (using 'fr_FR' locale)"      locale=fr_FR
153      $valgrind ./pcretest -q $testdata/testinput3 testtry      infile=$testdata/testinput3
154        outfile=$testdata/testoutput3
155      else
156        locale -a | grep '^french$' >/dev/null
157        if [ $? -eq 0 ] ; then
158          locale=french
159          sed 's/fr_FR/french/' $testdata/testinput3 >test3input
160          sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
161          infile=test3input
162          outfile=test3output
163        else
164          locale=
165        fi
166      fi
167    
168      if [ "$locale" != "" ] ; then
169        echo "Test 3: locale-specific features (using '$locale' locale)"
170        $valgrind ./pcretest -q $infile testtry
171      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
172        $cf testtry $testdata/testoutput3        $cf $outfile testtry
173        if [ $? != 0 ] ; then        if [ $? != 0 ] ; then
174          echo " "          echo " "
175          echo "Locale test did not run entirely successfully."          echo "Locale test did not run entirely successfully."
# Line 179  if [ $do3 = yes ] ; then Line 181  if [ $do3 = yes ] ; then
181      else exit 1      else exit 1
182      fi      fi
183    else    else
184      echo "Cannot test locale-specific features - 'fr_FR' locale not found,"      echo "Cannot test locale-specific features - neither the 'fr_FR' nor the"
185      echo "or the \"locale\" command is not available to check for it."      echo "'french' locale exists, or the \"locale\" command is not available"
186        echo "to check for them."
187      echo " "      echo " "
188    fi    fi
189  fi  fi
# Line 191  if [ $do4 = yes ] ; then Line 194  if [ $do4 = yes ] ; then
194    echo "Test 4: UTF-8 support (Perl compatible)"    echo "Test 4: UTF-8 support (Perl compatible)"
195    $valgrind ./pcretest -q $testdata/testinput4 testtry    $valgrind ./pcretest -q $testdata/testinput4 testtry
196    if [ $? = 0 ] ; then    if [ $? = 0 ] ; then
197      $cf testtry $testdata/testoutput4      $cf $testdata/testoutput4 testtry
198      if [ $? != 0 ] ; then exit 1; fi      if [ $? != 0 ] ; then exit 1; fi
199    else exit 1    else exit 1
200    fi    fi
# Line 203  if [ $do5 = yes ] ; then Line 206  if [ $do5 = yes ] ; then
206      echo "Test 5: API and internals for UTF-8 support (not Perl compatible)"      echo "Test 5: API and internals for UTF-8 support (not Perl compatible)"
207      $valgrind ./pcretest -q $testdata/testinput5 testtry      $valgrind ./pcretest -q $testdata/testinput5 testtry
208      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
209        $cf testtry $testdata/testoutput5        $cf $testdata/testoutput5 testtry
210        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
211      else exit 1      else exit 1
212      fi      fi
# Line 219  if [ $do6 = yes ] ; then Line 222  if [ $do6 = yes ] ; then
222      echo "Test 6: Unicode property support"      echo "Test 6: Unicode property support"
223      $valgrind ./pcretest -q $testdata/testinput6 testtry      $valgrind ./pcretest -q $testdata/testinput6 testtry
224      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
225        $cf testtry $testdata/testoutput6        $cf $testdata/testoutput6 testtry
226        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
227      else exit 1      else exit 1
228      fi      fi
# Line 236  if [ $do7 = yes ] ; then Line 239  if [ $do7 = yes ] ; then
239    echo "Test 7: DFA matching"    echo "Test 7: DFA matching"
240    $valgrind ./pcretest -q -dfa $testdata/testinput7 testtry    $valgrind ./pcretest -q -dfa $testdata/testinput7 testtry
241    if [ $? = 0 ] ; then    if [ $? = 0 ] ; then
242      $cf testtry $testdata/testoutput7      $cf $testdata/testoutput7 testtry
243      if [ $? != 0 ] ; then exit 1; fi      if [ $? != 0 ] ; then exit 1; fi
244    else exit 1    else exit 1
245    fi    fi
# Line 247  if [ $do8 = yes ] ; then Line 250  if [ $do8 = yes ] ; then
250    echo "Test 8: DFA matching with UTF-8"    echo "Test 8: DFA matching with UTF-8"
251    $valgrind ./pcretest -q -dfa $testdata/testinput8 testtry    $valgrind ./pcretest -q -dfa $testdata/testinput8 testtry
252    if [ $? = 0 ] ; then    if [ $? = 0 ] ; then
253      $cf testtry $testdata/testoutput8      $cf $testdata/testoutput8 testtry
254      if [ $? != 0 ] ; then exit 1; fi      if [ $? != 0 ] ; then exit 1; fi
255    else exit 1    else exit 1
256    fi    fi
# Line 258  if [ $do9 = yes ] ; then Line 261  if [ $do9 = yes ] ; then
261    echo "Test 9: DFA matching with Unicode properties"    echo "Test 9: DFA matching with Unicode properties"
262    $valgrind ./pcretest -q -dfa $testdata/testinput9 testtry    $valgrind ./pcretest -q -dfa $testdata/testinput9 testtry
263    if [ $? = 0 ] ; then    if [ $? = 0 ] ; then
264      $cf testtry $testdata/testoutput9      $cf $testdata/testoutput9 testtry
265      if [ $? != 0 ] ; then exit 1; fi      if [ $? != 0 ] ; then exit 1; fi
266    else exit 1    else exit 1
267    fi    fi

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

  ViewVC Help
Powered by ViewVC 1.1.5