/[pcre]/code/tags/pcre-8.20/RunTest
ViewVC logotype

Contents of /code/tags/pcre-8.20/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


Revision 63 - (hide annotations) (download)
Sat Feb 24 21:40:03 2007 UTC (7 years, 8 months ago) by nigel
Original Path: code/trunk/RunTest.in
File size: 3077 byte(s)
Load pcre-4.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    
19     while [ $# -gt 0 ] ; do
20     case $1 in
21     1) do1=yes;;
22     2) do2=yes;;
23     3) do3=yes;;
24     4) do4=yes;;
25     5) do5=yes;;
26     *) echo "Unknown test number $1"; exit 1;;
27     esac
28     shift
29     done
30    
31     if [ "@UTF8@" = "" ] ; then
32 nigel 63 if [ $do4 = yes ] ; then
33     echo "Can't run test 4 because UFT8 support is not configured"
34     exit 1
35     fi
36 nigel 49 if [ $do5 = yes ] ; then
37     echo "Can't run test 5 because UFT8 support is not configured"
38     exit 1
39     fi
40     fi
41    
42     if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a\
43 nigel 63 $do5 = no ] ; then
44 nigel 49 do1=yes
45     do2=yes
46     do3=yes
47 nigel 63 if [ "@UTF8@" != "" ] ; then do4=yes; fi
48 nigel 49 if [ "@UTF8@" != "" ] ; then do5=yes; fi
49     fi
50    
51     # Primary test, Perl-compatible
52    
53     if [ $do1 = yes ] ; then
54     echo "Testing main functionality (Perl compatible)"
55 nigel 53 ./pcretest $testdata/testinput1 testtry
56 nigel 49 if [ $? = 0 ] ; then
57 nigel 53 $cf testtry $testdata/testoutput1
58 nigel 49 if [ $? != 0 ] ; then exit 1; fi
59 nigel 63 echo " "
60 nigel 49 else exit 1
61     fi
62     fi
63    
64     # PCRE tests that are not Perl-compatible - API & error tests, mostly
65    
66     if [ $do2 = yes ] ; then
67     echo "Testing API and error handling (not Perl compatible)"
68 nigel 53 ./pcretest -i $testdata/testinput2 testtry
69 nigel 49 if [ $? = 0 ] ; then
70 nigel 53 $cf testtry $testdata/testoutput2
71 nigel 49 if [ $? != 0 ] ; then exit 1; fi
72     else exit 1
73     fi
74     fi
75    
76 nigel 63 if [ $do1 = yes -a $do2 = yes ] ; then
77 nigel 49 echo " "
78 nigel 63 echo "The two main tests ran OK"
79 nigel 49 echo " "
80     fi
81    
82     # Locale-specific tests, provided the "fr" locale is available
83    
84 nigel 63 if [ $do3 = yes ] ; then
85 nigel 49 locale -a | grep '^fr$' >/dev/null
86     if [ $? -eq 0 ] ; then
87     echo "Testing locale-specific features (using 'fr' locale)"
88 nigel 63 ./pcretest $testdata/testinput3 testtry
89 nigel 49 if [ $? = 0 ] ; then
90 nigel 63 $cf testtry $testdata/testoutput3
91 nigel 49 if [ $? != 0 ] ; then
92     echo " "
93     echo "Locale test did not run entirely successfully."
94     echo "This usually means that there is a problem with the locale"
95     echo "settings rather than a bug in PCRE."
96     else
97     echo "Locale test ran OK"
98     fi
99     echo " "
100     else exit 1
101     fi
102     else
103     echo "Cannot test locale-specific features - 'fr' locale not found,"
104     echo "or the \"locale\" command is not available to check for it."
105     echo " "
106     fi
107     fi
108    
109     # Additional tests for UTF8 support
110    
111 nigel 63 if [ $do4 = yes ] ; then
112     echo "Testing UTF-8 support (Perl compatible)"
113     ./pcretest $testdata/testinput4 testtry
114 nigel 49 if [ $? = 0 ] ; then
115 nigel 63 $cf testtry $testdata/testoutput4
116 nigel 49 if [ $? != 0 ] ; then exit 1; fi
117     else exit 1
118     fi
119     echo "UTF8 test ran OK"
120     echo " "
121     fi
122    
123 nigel 63 if [ $do5 = yes ] ; then
124     echo "Testing API and internals for UTF-8 support (not Perl compatible)"
125     ./pcretest $testdata/testinput5 testtry
126 nigel 49 if [ $? = 0 ] ; then
127 nigel 63 $cf testtry $testdata/testoutput5
128 nigel 49 if [ $? != 0 ] ; then exit 1; fi
129     else exit 1
130     fi
131     echo "UTF8 internals test ran OK"
132     echo " "
133     fi
134    
135     # End

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12