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

Diff of /code/trunk/RunTest.in

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

revision 63 by nigel, Sat Feb 24 21:40:03 2007 UTC revision 77 by nigel, Sat Feb 24 21:40:45 2007 UTC
# Line 15  do2=no Line 15  do2=no
15  do3=no  do3=no
16  do4=no  do4=no
17  do5=no  do5=no
18    do6=no
19    do7=no
20    do8=no
21    do9=no
22    
23  while [ $# -gt 0 ] ; do  while [ $# -gt 0 ] ; do
24    case $1 in    case $1 in
# Line 22  while [ $# -gt 0 ] ; do Line 26  while [ $# -gt 0 ] ; do
26      2) do2=yes;;      2) do2=yes;;
27      3) do3=yes;;      3) do3=yes;;
28      4) do4=yes;;      4) do4=yes;;
29      5) do5=yes;;      5) do5=yes;;
30        6) do6=yes;;
31        7) do7=yes;;
32        8) do8=yes;;
33        9) do9=yes;;
34      *) echo "Unknown test number $1"; exit 1;;      *) echo "Unknown test number $1"; exit 1;;
35    esac    esac
36    shift    shift
37  done  done
38    
39    if [ "@LINK_SIZE@" != "" -a "@LINK_SIZE@" != "-DLINK_SIZE=2" ] ; then
40      if [ $do2 = yes ] ; then
41        echo "Can't run test 2 with an internal link size other than 2"
42        exit 1
43      fi
44      if [ $do5 = yes ] ; then
45        echo "Can't run test 5 with an internal link size other than 2"
46        exit 1
47      fi
48      if [ $do6 = yes ] ; then
49        echo "Can't run test 6 with an internal link size other than 2"
50        exit 1
51      fi
52    fi
53    
54  if [ "@UTF8@" = "" ] ; then  if [ "@UTF8@" = "" ] ; then
55    if [ $do4 = yes ] ; then    if [ $do4 = yes ] ; then
56      echo "Can't run test 4 because UFT8 support is not configured"      echo "Can't run test 4 because UTF-8 support is not configured"
57      exit 1      exit 1
58    fi    fi
59    if [ $do5 = yes ] ; then    if [ $do5 = yes ] ; then
60      echo "Can't run test 5 because UFT8 support is not configured"      echo "Can't run test 5 because UTF-8 support is not configured"
61        exit 1
62      fi
63      if [ $do6 = yes ] ; then
64        echo "Can't run test 6 because UTF-8 support is not configured"
65        exit 1
66      fi
67      if [ $do8 = yes ] ; then
68        echo "Can't run test 8 because UTF-8 support is not configured"
69      exit 1      exit 1
70    fi    fi
71  fi    if [ $do9 = yes ] ; then
72        echo "Can't run test 9 because UTF-8 support is not configured"
73        exit 1
74      fi
75    fi
76    
77  if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a\  if [ "@UCP@" = "" ] ; then
78       $do5 = no ] ; then    if [ $do6 = yes ] ; then
79        echo "Can't run test 6 because Unicode property support is not configured"
80        exit 1
81      fi
82      if [ $do9 = yes ] ; then
83        echo "Can't run test 9 because Unicode property support is not configured"
84        exit 1
85      fi
86    fi
87    
88    if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
89         $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \
90         $do9 = no ] ; then
91    do1=yes    do1=yes
92    do2=yes    do2=yes
93    do3=yes    do3=yes
94    if [ "@UTF8@" != "" ] ; then do4=yes; fi    if [ "@UTF8@" != "" ] ; then do4=yes; fi
95    if [ "@UTF8@" != "" ] ; then do5=yes; fi    if [ "@UTF8@" != "" ] ; then do5=yes; fi
96      if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do6=yes; fi
97      do7=yes
98      if [ "@UTF8@" != "" ] ; then do8=yes; fi
99      if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do9=yes; fi
100  fi  fi
101    
102    # Show which release
103    
104    ./pcretest /dev/null
105    
106  # Primary test, Perl-compatible  # Primary test, Perl-compatible
107    
108  if [ $do1 = yes ] ; then  if [ $do1 = yes ] ; then
109    echo "Testing main functionality (Perl compatible)"    echo "Test 1: main functionality (Perl compatible)"
110    ./pcretest $testdata/testinput1 testtry    ./pcretest $testdata/testinput1 testtry
111    if [ $? = 0 ] ; then    if [ $? = 0 ] ; then
112      $cf testtry $testdata/testoutput1      $cf testtry $testdata/testoutput1
113      if [ $? != 0 ] ; then exit 1; fi      if [ $? != 0 ] ; then exit 1; fi
     echo " "  
114    else exit 1    else exit 1
115    fi    fi
116      echo "OK"
117      echo " "
118  fi  fi
119    
120  # PCRE tests that are not Perl-compatible - API & error tests, mostly  # PCRE tests that are not Perl-compatible - API & error tests, mostly
121    
122  if [ $do2 = yes ] ; then  if [ $do2 = yes ] ; then
123    echo "Testing API and error handling (not Perl compatible)"    if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
124    ./pcretest -i $testdata/testinput2 testtry      echo "Test 2: API and error handling (not Perl compatible)"
125    if [ $? = 0 ] ; then      ./pcretest -i $testdata/testinput2 testtry
126      $cf testtry $testdata/testoutput2      if [ $? = 0 ] ; then
127      if [ $? != 0 ] ; then exit 1; fi        $cf testtry $testdata/testoutput2
128    else exit 1        if [ $? != 0 ] ; then exit 1; fi
129        else exit 1
130        fi
131        echo "OK"
132        echo " "
133      else
134        echo Test 2 skipped for link size other than 2 \(@LINK_SIZE@\)
135        echo " "
136    fi    fi
137  fi  fi
138    
139  if [ $do1 = yes -a $do2 = yes ] ; then  # Locale-specific tests, provided the "fr_FR" locale is available
   echo " "  
   echo "The two main tests ran OK"  
   echo " "  
 fi  
   
 # Locale-specific tests, provided the "fr" locale is available  
140    
141  if [ $do3 = yes ] ; then  if [ $do3 = yes ] ; then
142    locale -a | grep '^fr$' >/dev/null    locale -a | grep '^fr_FR$' >/dev/null
143    if [ $? -eq 0 ] ; then    if [ $? -eq 0 ] ; then
144      echo "Testing locale-specific features (using 'fr' locale)"      echo "Test 3: locale-specific features (using 'fr_FR' locale)"
145      ./pcretest $testdata/testinput3 testtry      ./pcretest $testdata/testinput3 testtry
146      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
147        $cf testtry $testdata/testoutput3        $cf testtry $testdata/testoutput3
148        if [ $? != 0 ] ; then        if [ $? != 0 ] ; then
149          echo " "          echo " "
150          echo "Locale test did not run entirely successfully."          echo "Locale test did not run entirely successfully."
151          echo "This usually means that there is a problem with the locale"          echo "This usually means that there is a problem with the locale"
152          echo "settings rather than a bug in PCRE."          echo "settings rather than a bug in PCRE."
153        else        else
154        echo "Locale test ran OK"        echo "OK"
155        fi        fi
156        echo " "        echo " "
157      else exit 1      else exit 1
158      fi      fi
159    else    else
160      echo "Cannot test locale-specific features - 'fr' locale not found,"      echo "Cannot test locale-specific features - 'fr_FR' locale not found,"
161      echo "or the \"locale\" command is not available to check for it."      echo "or the \"locale\" command is not available to check for it."
162      echo " "      echo " "
163    fi    fi
164  fi  fi
165    
166  # Additional tests for UTF8 support  # Additional tests for UTF8 support
167    
168  if [ $do4 = yes ] ; then  if [ $do4 = yes ] ; then
169    echo "Testing UTF-8 support (Perl compatible)"    echo "Test 4: UTF-8 support (Perl compatible)"
170    ./pcretest $testdata/testinput4 testtry    ./pcretest $testdata/testinput4 testtry
171    if [ $? = 0 ] ; then    if [ $? = 0 ] ; then
172      $cf testtry $testdata/testoutput4      $cf testtry $testdata/testoutput4
173      if [ $? != 0 ] ; then exit 1; fi      if [ $? != 0 ] ; then exit 1; fi
174    else exit 1    else exit 1
175    fi    fi
176    echo "UTF8 test ran OK"    echo "OK"
177    echo " "    echo " "
178  fi  fi
179    
180  if [ $do5 = yes ] ; then  if [ $do5 = yes ] ; then
181    echo "Testing API and internals for UTF-8 support (not Perl compatible)"    if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
182    ./pcretest $testdata/testinput5 testtry      echo "Test 5: API and internals for UTF-8 support (not Perl compatible)"
183        ./pcretest $testdata/testinput5 testtry
184        if [ $? = 0 ] ; then
185          $cf testtry $testdata/testoutput5
186          if [ $? != 0 ] ; then exit 1; fi
187        else exit 1
188        fi
189        echo "OK"
190        echo " "
191      else
192        echo Test 5 skipped for link size other than 2 \(@LINK_SIZE@\)
193        echo " "
194      fi
195    fi
196    
197    if [ $do6 = yes ] ; then
198      if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
199        echo "Test 6: Unicode property support"
200        ./pcretest $testdata/testinput6 testtry
201        if [ $? = 0 ] ; then
202          $cf testtry $testdata/testoutput6
203          if [ $? != 0 ] ; then exit 1; fi
204        else exit 1
205        fi
206        echo "OK"
207        echo " "
208      else
209        echo Test 6 skipped for link size other than 2 \(@LINK_SIZE@\)
210        echo " "
211      fi
212    fi
213    
214    # Tests for DFA matching support
215    
216    if [ $do7 = yes ] ; then
217      echo "Test 7: DFA matching"
218      ./pcretest -dfa $testdata/testinput7 testtry
219      if [ $? = 0 ] ; then
220        $cf testtry $testdata/testoutput7
221        if [ $? != 0 ] ; then exit 1; fi
222      else exit 1
223      fi
224      echo "OK"
225      echo " "
226    fi
227    
228    if [ $do8 = yes ] ; then
229      echo "Test 8: DFA matching with UTF-8"
230      ./pcretest -dfa $testdata/testinput8 testtry
231      if [ $? = 0 ] ; then
232        $cf testtry $testdata/testoutput8
233        if [ $? != 0 ] ; then exit 1; fi
234      else exit 1
235      fi
236      echo "OK"
237      echo " "
238    fi
239    
240    if [ $do9 = yes ] ; then
241      echo "Test 9: DFA matching with Unicode properties"
242      ./pcretest -dfa $testdata/testinput9 testtry
243    if [ $? = 0 ] ; then    if [ $? = 0 ] ; then
244      $cf testtry $testdata/testoutput5      $cf testtry $testdata/testoutput9
245      if [ $? != 0 ] ; then exit 1; fi      if [ $? != 0 ] ; then exit 1; fi
246    else exit 1    else exit 1
247    fi    fi
248    echo "UTF8 internals test ran OK"    echo "OK"
249    echo " "    echo " "
250  fi  fi
251    

Legend:
Removed from v.63  
changed lines
  Added in v.77

  ViewVC Help
Powered by ViewVC 1.1.5