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

Legend:
Removed from v.75  
changed lines
  Added in v.97

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12