| 1 |
ph10 |
129 |
#! /bin/sh |
| 2 |
|
|
|
| 3 |
|
|
# This is a script for the use of PCRE maintainers. It configures and rebuilds |
| 4 |
|
|
# PCRE with a variety of configuration options, and in each case runs the tests |
| 5 |
|
|
# to ensure that all goes well. Every possible combination would take far too |
| 6 |
|
|
# long, so we use a representative sample. As well as testing that they work, |
| 7 |
|
|
# we use --disable-shared or --disable-static after the first test (which |
| 8 |
|
|
# builds both) to save a bit of time by building only one version for the |
| 9 |
|
|
# subsequent tests. |
| 10 |
|
|
|
| 11 |
|
|
# Some of the tests have to be skipped when PCRE is built with non-Unix newline |
| 12 |
|
|
# recognition. I am planning to reduce this as much as possible in due course. |
| 13 |
|
|
|
| 14 |
|
|
# This is in case the caller has set aliases (as I do - PH) |
| 15 |
|
|
|
| 16 |
|
|
unset cp ls mv rm |
| 17 |
|
|
|
| 18 |
|
|
# Use -v to make the output more verbose |
| 19 |
|
|
|
| 20 |
|
|
verbose=0 |
| 21 |
|
|
if [ "$1" = "-v" ] ; then verbose=1; fi |
| 22 |
|
|
|
| 23 |
|
|
# The first (empty) configuration builds with all the default settings. |
| 24 |
|
|
|
| 25 |
|
|
for opts in \ |
| 26 |
|
|
"" \ |
| 27 |
|
|
"--enable-utf8 --disable-static" \ |
| 28 |
|
|
"--enable-unicode-properties --disable-shared" \ |
| 29 |
|
|
"--enable-unicode-properties --disable-stack-for-recursion --disable-shared" \ |
| 30 |
|
|
"--enable-unicode-properties --disable-cpp --with-link-size=3 --disable-shared" \ |
| 31 |
|
|
"--enable-rebuild-chartables --disable-shared" \ |
| 32 |
|
|
"--enable-newline-is-any --disable-shared" \ |
| 33 |
|
|
"--enable-newline-is-cr --disable-shared" \ |
| 34 |
|
|
"--enable-newline-is-crlf --disable-shared" |
| 35 |
|
|
do |
| 36 |
|
|
rm -f *_unittest |
| 37 |
|
|
|
| 38 |
|
|
if [ "$opts" = "" ] ; then |
| 39 |
|
|
echo "===> Configuring with: default settings" |
| 40 |
|
|
else |
| 41 |
|
|
olen=`expr length "$opts"` |
| 42 |
|
|
if [ $olen -gt 56 ] ; then |
| 43 |
|
|
echo "===> Configuring with:" |
| 44 |
|
|
echo " $opts" |
| 45 |
|
|
else |
| 46 |
|
|
echo "===> Configuring with: $opts" |
| 47 |
|
|
fi |
| 48 |
|
|
fi |
| 49 |
|
|
|
| 50 |
|
|
./configure $opts >/dev/null 2>teststderr |
| 51 |
|
|
if [ $? -ne 0 ]; then |
| 52 |
|
|
echo " " |
| 53 |
|
|
echo "**** Error while configuring ****" |
| 54 |
|
|
cat teststderr |
| 55 |
|
|
exit 1 |
| 56 |
|
|
fi |
| 57 |
|
|
|
| 58 |
|
|
echo "===> Making" |
| 59 |
|
|
make >/dev/null 2>teststderr |
| 60 |
|
|
if [ $? -ne 0 ]; then |
| 61 |
|
|
echo " " |
| 62 |
|
|
echo "**** Error while making ****" |
| 63 |
|
|
cat teststderr |
| 64 |
|
|
exit 1 |
| 65 |
|
|
fi |
| 66 |
|
|
|
| 67 |
|
|
if [ $verbose -eq 1 ]; then |
| 68 |
|
|
./pcretest -C |
| 69 |
|
|
fi |
| 70 |
|
|
|
| 71 |
|
|
conf=`./pcretest -C` |
| 72 |
|
|
nl=`expr match "$conf" ".*Newline sequence is \([A-Z]*\)"` |
| 73 |
|
|
|
| 74 |
|
|
if [ "$nl" = "LF" -o "$nl" = "ANY" ]; then |
| 75 |
|
|
echo "===> Running C library tests" |
| 76 |
|
|
./RunTest >teststdout |
| 77 |
|
|
if [ $? -ne 0 ]; then |
| 78 |
|
|
echo " " |
| 79 |
|
|
echo "**** Test failed ****" |
| 80 |
|
|
cat teststdout |
| 81 |
|
|
exit 1 |
| 82 |
|
|
fi |
| 83 |
|
|
else |
| 84 |
|
|
echo "===> Skipping C library tests: newline is $nl" |
| 85 |
|
|
fi |
| 86 |
|
|
|
| 87 |
|
|
if [ "$nl" = "LF" ]; then |
| 88 |
|
|
echo "===> Running pcregrep tests" |
| 89 |
|
|
./RunGrepTest >teststdout 2>teststderr |
| 90 |
|
|
if [ $? -ne 0 ]; then |
| 91 |
|
|
echo " " |
| 92 |
|
|
echo "**** Test failed ****" |
| 93 |
|
|
cat teststderr |
| 94 |
|
|
cat teststdout |
| 95 |
|
|
exit 1 |
| 96 |
|
|
fi |
| 97 |
|
|
else |
| 98 |
|
|
echo "===> Skipping pcregrep tests: newline is $nl" |
| 99 |
|
|
fi |
| 100 |
|
|
|
| 101 |
|
|
if [ "$nl" = "LF" -o "$nl" = "ANY" ]; then |
| 102 |
|
|
if [ -f pcrecpp_unittest ] ; then |
| 103 |
|
|
for utest in pcrecpp_unittest \ |
| 104 |
|
|
pcre_scanner_unittest \ |
| 105 |
|
|
pcre_stringpiece_unittest |
| 106 |
|
|
do |
| 107 |
|
|
echo "===> Running $utest" |
| 108 |
|
|
$utest >teststdout |
| 109 |
|
|
if [ $? -ne 0 ]; then |
| 110 |
|
|
echo " " |
| 111 |
|
|
echo "**** Test failed ****" |
| 112 |
|
|
cat teststdout |
| 113 |
|
|
exit 1 |
| 114 |
|
|
fi |
| 115 |
|
|
done |
| 116 |
|
|
fi |
| 117 |
|
|
else |
| 118 |
|
|
echo "===> Skipping C++ tests: newline is $nl" |
| 119 |
|
|
fi |
| 120 |
|
|
|
| 121 |
|
|
done |
| 122 |
|
|
echo "===> All done" |
| 123 |
|
|
|
| 124 |
|
|
# End |