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

Contents of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


Revision 75 - (hide annotations) (download)
Sat Feb 24 21:40:37 2007 UTC (7 years, 6 months ago) by nigel
Original Path: code/trunk/RunTest.in
File size: 4742 byte(s)
Load pcre-5.0 into code/trunk.

1 nigel 49 #! /bin/sh
2    
3     # This file is generated by configure from RunTest.in. Make any changes
4     # to that file.
5    
6     # Run PCRE tests
7    
8     cf=diff
9 nigel 53 testdata=@top_srcdir@/testdata
10 nigel 49
11     # Select which tests to run; if no selection, run all
12    
13     do1=no
14     do2=no
15     do3=no
16     do4=no
17     do5=no
18 nigel 75 do6=no
19 nigel 49
20     while [ $# -gt 0 ] ; do
21     case $1 in
22     1) do1=yes;;
23     2) do2=yes;;
24     3) do3=yes;;
25     4) do4=yes;;
26     5) do5=yes;;
27 nigel 75 6) do6=yes;;
28 nigel 49 *) echo "Unknown test number $1"; exit 1;;
29     esac
30     shift
31     done
32    
33 nigel 75 if [ "@LINK_SIZE@" != "" -a "@LINK_SIZE@" != "-DLINK_SIZE=2" ] ; then
34     if [ $do2 = yes ] ; then
35     echo "Can't run test 2 with an internal link size other than 2"
36     exit 1
37     fi
38     if [ $do5 = yes ] ; then
39     echo "Can't run test 5 with an internal link size other than 2"
40     exit 1
41     fi
42     if [ $do6 = yes ] ; then
43     echo "Can't run test 6 with an internal link size other than 2"
44     exit 1
45     fi
46     fi
47    
48 nigel 49 if [ "@UTF8@" = "" ] ; then
49 nigel 63 if [ $do4 = yes ] ; then
50 nigel 75 echo "Can't run test 4 because UTF-8 support is not configured"
51 nigel 63 exit 1
52     fi
53 nigel 49 if [ $do5 = yes ] ; then
54 nigel 75 echo "Can't run test 5 because UTF-8 support is not configured"
55 nigel 49 exit 1
56     fi
57 nigel 75 if [ $do6 = yes ] ; then
58     echo "Can't run test 6 because UTF-8 support is not configured"
59     exit 1
60     fi
61 nigel 49 fi
62    
63 nigel 75 if [ "@UCP@" = "" ] ; then
64     if [ $do6 = yes ] ; then
65     echo "Can't run test 6 because Unicode property support is not configured"
66     exit 1
67     fi
68     fi
69    
70     if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
71     $do5 = no -a $do6 = no ] ; then
72 nigel 49 do1=yes
73 nigel 75 do2=yes
74 nigel 49 do3=yes
75 nigel 63 if [ "@UTF8@" != "" ] ; then do4=yes; fi
76 nigel 49 if [ "@UTF8@" != "" ] ; then do5=yes; fi
77 nigel 75 if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do6=yes; fi
78 nigel 49 fi
79    
80 nigel 73 # Show which release
81    
82     ./pcretest /dev/null
83    
84 nigel 49 # Primary test, Perl-compatible
85    
86     if [ $do1 = yes ] ; then
87 nigel 75 echo "Test 1: main functionality (Perl compatible)"
88 nigel 53 ./pcretest $testdata/testinput1 testtry
89 nigel 49 if [ $? = 0 ] ; then
90 nigel 53 $cf testtry $testdata/testoutput1
91 nigel 49 if [ $? != 0 ] ; then exit 1; fi
92 nigel 63 echo " "
93 nigel 49 else exit 1
94     fi
95     fi
96    
97     # PCRE tests that are not Perl-compatible - API & error tests, mostly
98    
99     if [ $do2 = yes ] ; then
100 nigel 75 if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
101     echo "Test 2: API and error handling (not Perl compatible)"
102     ./pcretest -i $testdata/testinput2 testtry
103     if [ $? = 0 ] ; then
104     $cf testtry $testdata/testoutput2
105     if [ $? != 0 ] ; then exit 1; fi
106     else exit 1
107     fi
108     else
109     echo Test 2 skipped for link size other than 2 \(@LINK_SIZE@\)
110     fi
111 nigel 49 fi
112    
113 nigel 63 if [ $do1 = yes -a $do2 = yes ] ; then
114 nigel 49 echo " "
115 nigel 63 echo "The two main tests ran OK"
116 nigel 49 echo " "
117     fi
118    
119 nigel 73 # Locale-specific tests, provided the "fr_FR" locale is available
120 nigel 49
121 nigel 63 if [ $do3 = yes ] ; then
122 nigel 73 locale -a | grep '^fr_FR$' >/dev/null
123 nigel 49 if [ $? -eq 0 ] ; then
124 nigel 75 echo "Test 3: locale-specific features (using 'fr_FR' locale)"
125 nigel 63 ./pcretest $testdata/testinput3 testtry
126 nigel 49 if [ $? = 0 ] ; then
127 nigel 63 $cf testtry $testdata/testoutput3
128 nigel 49 if [ $? != 0 ] ; then
129     echo " "
130     echo "Locale test did not run entirely successfully."
131     echo "This usually means that there is a problem with the locale"
132     echo "settings rather than a bug in PCRE."
133     else
134     echo "Locale test ran OK"
135     fi
136     echo " "
137     else exit 1
138     fi
139     else
140 nigel 73 echo "Cannot test locale-specific features - 'fr_FR' locale not found,"
141 nigel 49 echo "or the \"locale\" command is not available to check for it."
142     echo " "
143     fi
144     fi
145    
146     # Additional tests for UTF8 support
147    
148 nigel 63 if [ $do4 = yes ] ; then
149 nigel 75 echo "Test 4: UTF-8 support (Perl compatible)"
150 nigel 63 ./pcretest $testdata/testinput4 testtry
151 nigel 49 if [ $? = 0 ] ; then
152 nigel 63 $cf testtry $testdata/testoutput4
153 nigel 49 if [ $? != 0 ] ; then exit 1; fi
154     else exit 1
155     fi
156     echo "UTF8 test ran OK"
157     echo " "
158     fi
159    
160 nigel 63 if [ $do5 = yes ] ; then
161 nigel 75 if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
162     echo "Test 5: API and internals for UTF-8 support (not Perl compatible)"
163     ./pcretest $testdata/testinput5 testtry
164     if [ $? = 0 ] ; then
165     $cf testtry $testdata/testoutput5
166     if [ $? != 0 ] ; then exit 1; fi
167     else exit 1
168     fi
169     echo "UTF8 internals test ran OK"
170     echo " "
171     else
172     echo Test 5 skipped for link size other than 2 \(@LINK_SIZE@\)
173     fi
174 nigel 49 fi
175    
176 nigel 75 if [ $do6 = yes ] ; then
177     if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
178     echo "Test 6: Unicode property support"
179     ./pcretest $testdata/testinput6 testtry
180     if [ $? = 0 ] ; then
181     $cf testtry $testdata/testoutput6
182     if [ $? != 0 ] ; then exit 1; fi
183     else exit 1
184     fi
185     echo "Unicode properties test ran OK"
186     echo " "
187     else
188     echo Test 6 skipped for link size other than 2 \(@LINK_SIZE@\)
189     fi
190     fi
191    
192 nigel 49 # End

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12