1 |
#! /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 |
|
10 |
# Select which tests to run; if no selection, run all
|
11 |
|
12 |
do1=no
|
13 |
do2=no
|
14 |
do3=no
|
15 |
do4=no
|
16 |
do5=no
|
17 |
do6=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 |
6) do6=yes;;
|
27 |
*) echo "Unknown test number $1"; exit 1;;
|
28 |
esac
|
29 |
shift
|
30 |
done
|
31 |
|
32 |
if [ "@UTF8@" = "" ] ; then
|
33 |
if [ $do5 = yes ] ; then
|
34 |
echo "Can't run test 5 because UFT8 support is not configured"
|
35 |
exit 1
|
36 |
fi
|
37 |
if [ $do6 = yes ] ; then
|
38 |
echo "Can't run test 6 because UFT8 support is not configured"
|
39 |
exit 1
|
40 |
fi
|
41 |
fi
|
42 |
|
43 |
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a\
|
44 |
$do5 = no -a $do6 = no ] ; then
|
45 |
do1=yes
|
46 |
do2=yes
|
47 |
do3=yes
|
48 |
do4=yes
|
49 |
if [ "@UTF8@" != "" ] ; then do5=yes; fi
|
50 |
if [ "@UTF8@" != "" ] ; then do6=yes; fi
|
51 |
fi
|
52 |
|
53 |
# Primary test, Perl-compatible
|
54 |
|
55 |
if [ $do1 = yes ] ; then
|
56 |
echo "Testing main functionality (Perl compatible)"
|
57 |
./pcretest testdata/testinput1 testtry
|
58 |
if [ $? = 0 ] ; then
|
59 |
$cf testtry testdata/testoutput1
|
60 |
if [ $? != 0 ] ; then exit 1; fi
|
61 |
else exit 1
|
62 |
fi
|
63 |
fi
|
64 |
|
65 |
# PCRE tests that are not Perl-compatible - API & error tests, mostly
|
66 |
|
67 |
if [ $do2 = yes ] ; then
|
68 |
echo "Testing API and error handling (not Perl compatible)"
|
69 |
./pcretest -i testdata/testinput2 testtry
|
70 |
if [ $? = 0 ] ; then
|
71 |
$cf testtry testdata/testoutput2
|
72 |
if [ $? != 0 ] ; then exit 1; fi
|
73 |
else exit 1
|
74 |
fi
|
75 |
fi
|
76 |
|
77 |
# Additional Perl-compatible tests for Perl 5.005's new features
|
78 |
|
79 |
if [ $do3 = yes ] ; then
|
80 |
echo "Testing Perl 5.005 features (Perl 5.005 compatible)"
|
81 |
./pcretest testdata/testinput3 testtry
|
82 |
if [ $? = 0 ] ; then
|
83 |
$cf testtry testdata/testoutput3
|
84 |
if [ $? != 0 ] ; then exit 1; fi
|
85 |
else exit 1
|
86 |
fi
|
87 |
fi
|
88 |
|
89 |
if [ $do1 = yes -a $do2 = yes -a $do3 = yes ] ; then
|
90 |
echo " "
|
91 |
echo "The three main tests all ran OK"
|
92 |
echo " "
|
93 |
fi
|
94 |
|
95 |
# Locale-specific tests, provided the "fr" locale is available
|
96 |
|
97 |
if [ $do4 = yes ] ; then
|
98 |
locale -a | grep '^fr$' >/dev/null
|
99 |
if [ $? -eq 0 ] ; then
|
100 |
echo "Testing locale-specific features (using 'fr' locale)"
|
101 |
./pcretest testdata/testinput4 testtry
|
102 |
if [ $? = 0 ] ; then
|
103 |
$cf testtry testdata/testoutput4
|
104 |
if [ $? != 0 ] ; then
|
105 |
echo " "
|
106 |
echo "Locale test did not run entirely successfully."
|
107 |
echo "This usually means that there is a problem with the locale"
|
108 |
echo "settings rather than a bug in PCRE."
|
109 |
else
|
110 |
echo "Locale test ran OK"
|
111 |
fi
|
112 |
echo " "
|
113 |
else exit 1
|
114 |
fi
|
115 |
else
|
116 |
echo "Cannot test locale-specific features - 'fr' locale not found,"
|
117 |
echo "or the \"locale\" command is not available to check for it."
|
118 |
echo " "
|
119 |
fi
|
120 |
fi
|
121 |
|
122 |
# Additional tests for UTF8 support
|
123 |
|
124 |
if [ $do5 = yes ] ; then
|
125 |
echo "Testing experimental, incomplete UTF8 support (Perl compatible)"
|
126 |
./pcretest testdata/testinput5 testtry
|
127 |
if [ $? = 0 ] ; then
|
128 |
$cf testtry testdata/testoutput5
|
129 |
if [ $? != 0 ] ; then exit 1; fi
|
130 |
else exit 1
|
131 |
fi
|
132 |
echo "UTF8 test ran OK"
|
133 |
echo " "
|
134 |
fi
|
135 |
|
136 |
if [ $do6 = yes ] ; then
|
137 |
echo "Testing API and internals for UTF8 support (not Perl compatible)"
|
138 |
./pcretest testdata/testinput6 testtry
|
139 |
if [ $? = 0 ] ; then
|
140 |
$cf testtry testdata/testoutput6
|
141 |
if [ $? != 0 ] ; then exit 1; fi
|
142 |
else exit 1
|
143 |
fi
|
144 |
echo "UTF8 internals test ran OK"
|
145 |
echo " "
|
146 |
fi
|
147 |
|
148 |
# End
|