summaryrefslogtreecommitdiff
path: root/RunTest
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-09-10 11:02:48 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-09-10 11:02:48 +0000
commit7a3e01c442328741902c3c4b974d0e3024f645d1 (patch)
treee61b4534e91f97df907571a92db57623422e71d7 /RunTest
parent640564bfeb0860032d98439dfa9f5585af59a09e (diff)
downloadpcre-7a3e01c442328741902c3c4b974d0e3024f645d1.tar.gz
General spring-clean of EBCDIC-related issues in the code, which had decayed
over time. Also the documentation. Added one test that can be run in an ASCII world to do a little testing of EBCDIC-related things. git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1033 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'RunTest')
-rwxr-xr-xRunTest94
1 files changed, 65 insertions, 29 deletions
diff --git a/RunTest b/RunTest
index b9a0456..61da889 100755
--- a/RunTest
+++ b/RunTest
@@ -2,7 +2,7 @@
# Run the PCRE tests using the pcretest program. The appropriate tests are
# selected, depending on which build-time options were used.
-
+#
# All tests are now run both with and without -s, to ensure that everything is
# tested with and without studying. However, there are some tests that produce
# different output after studying, typically when we are tracing the actual
@@ -12,23 +12,31 @@
# any difference to their output. There is also one test which compiles invalid
# UTF-8 with the UTF-8 check turned off; for this, studying must also be
# disabled with /SS.
-
+#
# When JIT support is available, all the tests are also run with -s+ to test
# (again, almost) everything with studying and the JIT option. There are also
# two tests for JIT-specific features, one to be run when JIT support is
# available, and one when it is not.
-
+#
# Whichever of the 8-bit and 16-bit libraries exist are tested. It is also
# possible to select which to test by the arguments -8 or -16.
-
+#
# Other arguments for this script can be individual test numbers, or the word
# "valgrind", or "sim" followed by an argument to run cross-compiled
# executables under a simulator, for example:
#
# RunTest 3 sim "qemu-arm -s 8388608"
#
-# Finally, if the script is obeyed as "RunTest list", a list of available
-# tests is output, but none of them are run.
+#
+# There are two special cases where only one argument is allowed:
+#
+# If the first and only argument is "ebcdic", the script runs the special
+# EBCDIC test that can be useful for checking certain EBCDIC features, even
+# when run in an ASCII environment.
+#
+# If the script is obeyed as "RunTest list", a list of available tests is
+# output, but none of them are run.
+
# Define test titles in variables so that they can be output as a list. Some
# of them are modified (e.g. with -8 or -16) when used in the actual tests.
@@ -83,6 +91,56 @@ if [ $# -eq 1 -a "$1" = "list" ]; then
exit 0
fi
+# Set up a suitable "diff" command for comparison. Some systems
+# have a diff that lacks a -u option. Try to deal with this.
+
+cf="diff"
+diff -u /dev/null /dev/null 2>/dev/null && cf="diff -u"
+
+# Find the test data
+
+if [ -n "$srcdir" -a -d "$srcdir" ] ; then
+ testdata="$srcdir/testdata"
+elif [ -d "./testdata" ] ; then
+ testdata=./testdata
+elif [ -d "../testdata" ] ; then
+ testdata=../testdata
+else
+ echo "Cannot find the testdata directory"
+ exit 1
+fi
+
+
+# ------ Special EBCDIC Test -------
+
+if [ $# -eq 1 -a "$1" = "ebcdic" ]; then
+ ./pcretest -C ebcdic >/dev/null
+ ebcdic=$?
+ if [ $ebcdic -ne 1 ] ; then
+ echo "Cannot run EBCDIC tests: EBCDIC support not compiled"
+ exit 1
+ fi
+
+ for opt in "" "-s" "-dfa" "-s -dfa"; do
+ ./pcretest -q $opt $testdata/testinputEBC >testtry
+ if [ $? = 0 ] ; then
+ $cf $testdata/testoutputEBC testtry
+ if [ $? != 0 ] ; then exit 1; fi
+ else exit 1
+ fi
+ if [ "$opt" = "-s" ] ; then echo " OK with study"
+ elif [ "$opt" = "-dfa" ] ; then echo " OK using DFA"
+ elif [ "$opt" = "-s -dfa" ] ; then echo " OK using DFA with study"
+ else echo " OK"
+ fi
+ done
+
+exit 0
+fi
+
+
+# ------ Normal Tests ------
+
# Default values
valgrind=
@@ -152,29 +210,7 @@ while [ $# -gt 0 ] ; do
shift
done
-# Set up a suitable "diff" command for comparison. Some systems
-# have a diff that lacks a -u option. Try to deal with this.
-
-cf="diff"
-diff -u /dev/null /dev/null 2>/dev/null && cf="diff -u"
-
-# Find the test data
-
-if [ -n "$srcdir" -a -d "$srcdir" ] ; then
- testdata="$srcdir/testdata"
-elif [ -d "./testdata" ] ; then
- testdata=./testdata
-elif [ -d "../testdata" ] ; then
- testdata=../testdata
-else
- echo "Cannot find the testdata directory"
- exit 1
-fi
-
-# Find which optional facilities are available. In some Windows environments
-# the output of pcretest -C has CRLF at the end of each line, but the shell
-# strips only linefeeds from the output of a `backquoted` command. Hence the
-# alternative patterns.
+# Find which optional facilities are available.
$sim ./pcretest -C linksize >/dev/null
link_size=$?