summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-03-20 16:33:54 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-03-20 16:33:54 +0000
commit0948ced6ee1d72bed977544e5f6e015db66c9a73 (patch)
treea7f3a253f55599b82a1831edbc51b0f3144c52d9
parenta281832efa782b67b26a04360a139de899e4ad62 (diff)
downloadpcre-0948ced6ee1d72bed977544e5f6e015db66c9a73.tar.gz
The maint/ManyConfigTests script runs a whole slew of tests.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@129 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rwxr-xr-xmaint/ManyConfigTests124
-rw-r--r--maint/README77
2 files changed, 153 insertions, 48 deletions
diff --git a/maint/ManyConfigTests b/maint/ManyConfigTests
new file mode 100755
index 0000000..431c756
--- /dev/null
+++ b/maint/ManyConfigTests
@@ -0,0 +1,124 @@
+#! /bin/sh
+
+# This is a script for the use of PCRE maintainers. It configures and rebuilds
+# PCRE with a variety of configuration options, and in each case runs the tests
+# to ensure that all goes well. Every possible combination would take far too
+# long, so we use a representative sample. As well as testing that they work,
+# we use --disable-shared or --disable-static after the first test (which
+# builds both) to save a bit of time by building only one version for the
+# subsequent tests.
+
+# Some of the tests have to be skipped when PCRE is built with non-Unix newline
+# recognition. I am planning to reduce this as much as possible in due course.
+
+# This is in case the caller has set aliases (as I do - PH)
+
+unset cp ls mv rm
+
+# Use -v to make the output more verbose
+
+verbose=0
+if [ "$1" = "-v" ] ; then verbose=1; fi
+
+# The first (empty) configuration builds with all the default settings.
+
+for opts in \
+ "" \
+ "--enable-utf8 --disable-static" \
+ "--enable-unicode-properties --disable-shared" \
+ "--enable-unicode-properties --disable-stack-for-recursion --disable-shared" \
+ "--enable-unicode-properties --disable-cpp --with-link-size=3 --disable-shared" \
+ "--enable-rebuild-chartables --disable-shared" \
+ "--enable-newline-is-any --disable-shared" \
+ "--enable-newline-is-cr --disable-shared" \
+ "--enable-newline-is-crlf --disable-shared"
+do
+ rm -f *_unittest
+
+ if [ "$opts" = "" ] ; then
+ echo "===> Configuring with: default settings"
+ else
+ olen=`expr length "$opts"`
+ if [ $olen -gt 56 ] ; then
+ echo "===> Configuring with:"
+ echo " $opts"
+ else
+ echo "===> Configuring with: $opts"
+ fi
+ fi
+
+ ./configure $opts >/dev/null 2>teststderr
+ if [ $? -ne 0 ]; then
+ echo " "
+ echo "**** Error while configuring ****"
+ cat teststderr
+ exit 1
+ fi
+
+ echo "===> Making"
+ make >/dev/null 2>teststderr
+ if [ $? -ne 0 ]; then
+ echo " "
+ echo "**** Error while making ****"
+ cat teststderr
+ exit 1
+ fi
+
+ if [ $verbose -eq 1 ]; then
+ ./pcretest -C
+ fi
+
+ conf=`./pcretest -C`
+ nl=`expr match "$conf" ".*Newline sequence is \([A-Z]*\)"`
+
+ if [ "$nl" = "LF" -o "$nl" = "ANY" ]; then
+ echo "===> Running C library tests"
+ ./RunTest >teststdout
+ if [ $? -ne 0 ]; then
+ echo " "
+ echo "**** Test failed ****"
+ cat teststdout
+ exit 1
+ fi
+ else
+ echo "===> Skipping C library tests: newline is $nl"
+ fi
+
+ if [ "$nl" = "LF" ]; then
+ echo "===> Running pcregrep tests"
+ ./RunGrepTest >teststdout 2>teststderr
+ if [ $? -ne 0 ]; then
+ echo " "
+ echo "**** Test failed ****"
+ cat teststderr
+ cat teststdout
+ exit 1
+ fi
+ else
+ echo "===> Skipping pcregrep tests: newline is $nl"
+ fi
+
+ if [ "$nl" = "LF" -o "$nl" = "ANY" ]; then
+ if [ -f pcrecpp_unittest ] ; then
+ for utest in pcrecpp_unittest \
+ pcre_scanner_unittest \
+ pcre_stringpiece_unittest
+ do
+ echo "===> Running $utest"
+ $utest >teststdout
+ if [ $? -ne 0 ]; then
+ echo " "
+ echo "**** Test failed ****"
+ cat teststdout
+ exit 1
+ fi
+ done
+ fi
+ else
+ echo "===> Skipping C++ tests: newline is $nl"
+ fi
+
+done
+echo "===> All done"
+
+# End
diff --git a/maint/README b/maint/README
index 73d76a2..9bf0562 100644
--- a/maint/README
+++ b/maint/README
@@ -16,32 +16,33 @@ also contains some notes for maintainers. Its contents are:
Files in the maint directory
----------------------------
-Builducptable A Perl script that creates the contents of the ucptable.h file
- from two Unicode data files, which themselves are downloaded
- from the Unicode web site. Run this script in the "maint"
- directory.
-
-Tech.Notes Some notes about the internals of the PCRE code.
-
-Unicode.tables The files in this directory, Scripts.txt and UnicodeData.txt,
- were downloaded from the Unicode web site. They contain
- information about Unicode characters and scripts.
-
-ucptest.c A short C program for testing the Unicode property functions in
- pcre_ucp_searchfuncs.c, mainly useful after rebuilding the
- Unicode property table. Compile and run this in the "maint"
- directory.
-
-ucptestdata A directory containing two files, testinput1 and testoutput1,
- to use in conjunction with the ucptest program.
-
-utf8.c A short, freestanding C program for converting a Unicode code
- point into a sequence of bytes in the UTF-8 encoding, and vice
- versa. If its argument is a hex number such as 0x1234, it
- outputs a list of the equivalent UTF-8 bytes. If its argument
- is sequence of concatenated UTF-8 bytes (e.g. e188b4) it treats
- them as a UTF-8 character and outputs the equivalent code point
- in hex.
+Builducptable A Perl script that creates the contents of the ucptable.h file
+ from two Unicode data files, which themselves are downloaded
+ from the Unicode web site. Run this script in the "maint"
+ directory.
+
+ManyConfigTests A shell script that runs "configure, make, test" a number of
+ times with different configuration settings.
+
+Unicode.tables The files in this directory, Scripts.txt and UnicodeData.txt,
+ were downloaded from the Unicode web site. They contain
+ information about Unicode characters and scripts.
+
+ucptest.c A short C program for testing the Unicode property functions
+ in pcre_ucp_searchfuncs.c, mainly useful after rebuilding the
+ Unicode property table. Compile and run this in the "maint"
+ directory.
+
+ucptestdata A directory containing two files, testinput1 and testoutput1,
+ to use in conjunction with the ucptest program.
+
+utf8.c A short, freestanding C program for converting a Unicode code
+ point into a sequence of bytes in the UTF-8 encoding, and vice
+ versa. If its argument is a hex number such as 0x1234, it
+ outputs a list of the equivalent UTF-8 bytes. If its argument
+ is sequence of concatenated UTF-8 bytes (e.g. e188b4) it
+ treats them as a UTF-8 character and outputs the equivalent
+ code point in hex.
Updating to a new Unicode release
@@ -65,20 +66,7 @@ distribution for a new release.
. Run ./autogen.sh to ensure everything is up-to-date.
. Compile and test with many different config options, and combinations of
- options:
-
- * Totally standard ./configure with no options
- * --disable-shared
- * --disable-static
- * --enable-utf8
- * --enable-unicode-properties
- * --disable-cpp
- * --with-link-size=3 (occasionally check with 4 as well)
- * --disable-stack-for-recursion
- * --enable-newline-is-any
-
- I've never automated this, but perhaps I should. The newline testing could be
- enhanced; at present, some tests fail unless plain LF is a newline.
+ options. The maint/ManyConfigTests script now encapsulates this testing.
. Run perltest.pl on the test data for tests 1 and 4. The output should match
the PCRE test output, apart from the version identification at the top. The
@@ -264,14 +252,7 @@ others are relatively new.
. Someone suggested --disable-callout to save code space when callouts are
never wanted. This seems rather marginal.
-. Automate some of the testing before release into a script that compiles with
- different options and runs the tests in each case.
-
-. How about distributing a fixed pcre_chartables.c file and abandoning the
- on-the-fly generation using dftables. This will make cross-compiling easier,
- and in any case, locales are going out of fashion.
-
Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk
-Last updated: 12 March 2007
+Last updated: 20 March 2007