2014-05-13 13:20:03 +02:00
|
|
|
#! /bin/sh
|
|
|
|
|
2014-08-10 18:09:24 +02:00
|
|
|
# This is a script for the use of PCRE2 maintainers. It configures and rebuilds
|
2014-05-13 13:20:03 +02:00
|
|
|
# PCRE2 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. This script should be run in the
|
|
|
|
# PCRE2 source directory.
|
|
|
|
|
2014-08-10 18:09:24 +02:00
|
|
|
# While debugging, it is sometimes useful to be able to cut out some of the
|
|
|
|
# tests, in order to run those that are giving errors. The following options
|
|
|
|
# do this:
|
|
|
|
#
|
2015-09-11 18:56:47 +02:00
|
|
|
# -noasan skip the test that uses -fsanitize=address
|
|
|
|
# -nousan skip the test that uses -fsanitize=undefined
|
|
|
|
# -nodebug skip the test that uses --enable-debug
|
|
|
|
# -nojit skip all JIT tests
|
|
|
|
# -nojitmain skip non-valgrind JIT tests
|
|
|
|
# -nojitvalgrind skip JIT tests with valgrind
|
2016-01-30 17:00:55 +01:00
|
|
|
# -nomain skip all the main (non-JIT) set of tests
|
|
|
|
# -nomainvalgrind skip the main (non-JIT) valgrind tests
|
2015-09-11 18:56:47 +02:00
|
|
|
# -notmp skip the test in a temporary directory
|
2016-01-30 17:00:55 +01:00
|
|
|
# -novalgrind skip all the valgrind tests
|
|
|
|
|
|
|
|
# Alternatively, if any of those names are given with '+' instead of '-no',
|
|
|
|
# only those groups named with '+' are run (e.g. +jit). If -dummy is given,
|
|
|
|
# no tests are actually run - this provides a means of testing the selectors.
|
2014-08-10 18:09:24 +02:00
|
|
|
|
|
|
|
# The -v option causes a call to 'pcre2test -C' to happen for each
|
|
|
|
# configuration.
|
|
|
|
|
2015-04-15 18:12:51 +02:00
|
|
|
useasan=1
|
2015-05-17 18:11:40 +02:00
|
|
|
useusan=1
|
2015-06-03 19:03:37 +02:00
|
|
|
usedebug=1
|
2014-08-10 18:09:24 +02:00
|
|
|
usejit=1
|
2015-09-11 18:56:47 +02:00
|
|
|
usejitvalgrind=1
|
2014-08-10 18:09:24 +02:00
|
|
|
usemain=1
|
2015-09-11 18:56:47 +02:00
|
|
|
usemainvalgrind=1
|
2014-08-10 18:09:24 +02:00
|
|
|
usetmp=1
|
|
|
|
usevalgrind=1
|
2016-01-30 17:00:55 +01:00
|
|
|
|
|
|
|
dummy=0
|
|
|
|
seenplus=0
|
2014-08-10 18:09:24 +02:00
|
|
|
verbose=0
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2014-08-10 18:09:24 +02:00
|
|
|
while [ $# -gt 0 ] ; do
|
|
|
|
case $1 in
|
2016-01-30 17:00:55 +01:00
|
|
|
+*) if [ $seenplus -eq 0 ]; then
|
|
|
|
useasan=0
|
|
|
|
useusan=0
|
|
|
|
usedebug=0
|
|
|
|
usejit=0
|
|
|
|
usejitvalgrind=0
|
|
|
|
usemain=0
|
|
|
|
usemainvalgrind=0
|
|
|
|
usetmp=0
|
|
|
|
seenplus=1
|
|
|
|
fi;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
-dummy) dummy=1;;
|
|
|
|
-v) verbose=1;;
|
2015-09-11 18:56:47 +02:00
|
|
|
-noasan) useasan=0;;
|
|
|
|
-nousan) useusan=0;;
|
|
|
|
-nodebug) usedebug=0;;
|
|
|
|
-nojit) usejit=0; usejitvalgrind=0;;
|
|
|
|
-nojitmain) usejit=0;;
|
|
|
|
-nojitvalgrind) usejitvalgrind=0;;
|
|
|
|
-nomain) usemain=0; usemainvalgrind=0;;
|
|
|
|
-nomainvalgrind) usemainvalgrind=0;;
|
|
|
|
-notmp) usetmp=0;;
|
|
|
|
-novalgrind) usevalgrind=0;;
|
2016-01-30 17:00:55 +01:00
|
|
|
+asan) useasan=1;;
|
|
|
|
+usan) useusan=1;;
|
|
|
|
+debug) usedebug=1;;
|
|
|
|
+jit) usejit=1; usejitvalgrind=1;;
|
|
|
|
+jitmain) usejit=1;;
|
|
|
|
+jitvalgrind) usejitvalgrind=1;;
|
|
|
|
+main) usemain=1; usemainvalgrind=1;;
|
|
|
|
+mainvalgrind) usemainvalgrind=1;;
|
|
|
|
+tmp) usetmp=1;;
|
2016-06-29 18:43:02 +02:00
|
|
|
+valgrind) usevalgrind=1; usejitvalgrind=1; usemainvalgrind=1;;
|
2015-09-11 18:56:47 +02:00
|
|
|
*) echo "Unknown option '$1'"; exit 1;;
|
2014-08-10 18:09:24 +02:00
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2015-09-11 18:56:47 +02:00
|
|
|
if [ $usejitvalgrind -eq 0 -a $usemainvalgrind -eq 0 ] ; then
|
|
|
|
usevalgrind=0
|
|
|
|
fi
|
|
|
|
|
2014-05-13 13:20:03 +02:00
|
|
|
# This is in case the caller has set aliases (as I do - PH)
|
|
|
|
|
|
|
|
unset cp ls mv rm
|
|
|
|
|
|
|
|
# This is a temporary directory for testing out-of-line builds
|
|
|
|
|
2014-08-10 18:09:24 +02:00
|
|
|
tmp=/tmp/pcre2testing
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
# Don't bother with compiler optimization for most tests; it just slows down
|
2014-08-10 18:09:24 +02:00
|
|
|
# compilation a lot (and running the tests themselves is quick). However, one
|
|
|
|
# special test turns optimization on, because it can provoke some compiler
|
2014-05-13 13:20:03 +02:00
|
|
|
# warnings.
|
|
|
|
|
2014-11-21 13:19:37 +01:00
|
|
|
CFLAGS="-g"
|
|
|
|
OFLAGS="-O0"
|
2014-08-10 18:09:24 +02:00
|
|
|
ISGCC=0
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
# If the compiler is gcc, add a lot of warning switches.
|
|
|
|
|
2014-11-18 19:32:12 +01:00
|
|
|
cc --version >/tmp/pcre2ccversion 2>/dev/null
|
|
|
|
if [ $? -eq 0 ] && grep GCC /tmp/pcre2ccversion >/dev/null; then
|
2014-08-10 18:09:24 +02:00
|
|
|
ISGCC=1
|
2014-05-13 13:20:03 +02:00
|
|
|
CFLAGS="$CFLAGS -Wall"
|
|
|
|
CFLAGS="$CFLAGS -Wno-overlength-strings"
|
|
|
|
CFLAGS="$CFLAGS -Wpointer-arith"
|
|
|
|
CFLAGS="$CFLAGS -Wwrite-strings"
|
|
|
|
CFLAGS="$CFLAGS -Wundef -Wshadow"
|
|
|
|
CFLAGS="$CFLAGS -Wmissing-field-initializers"
|
2014-08-10 18:09:24 +02:00
|
|
|
CFLAGS="$CFLAGS -Wunused-parameter"
|
2014-05-13 13:20:03 +02:00
|
|
|
CFLAGS="$CFLAGS -Wextra -Wformat"
|
|
|
|
CFLAGS="$CFLAGS -Wbad-function-cast"
|
|
|
|
CFLAGS="$CFLAGS -Wmissing-declarations"
|
|
|
|
CFLAGS="$CFLAGS -Wnested-externs"
|
|
|
|
CFLAGS="$CFLAGS -pedantic"
|
|
|
|
CFLAGS="$CFLAGS -Wuninitialized"
|
2017-08-12 18:22:52 +02:00
|
|
|
CFLAGS="$CFLAGS -Wmaybe-uninitialized"
|
2014-05-13 13:20:03 +02:00
|
|
|
CFLAGS="$CFLAGS -Wmissing-prototypes"
|
|
|
|
CFLAGS="$CFLAGS -Wstrict-prototypes"
|
|
|
|
fi
|
2014-11-18 19:32:12 +01:00
|
|
|
rm -f /tmp/pcre2ccversion
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
# This function runs a single test with the set of configuration options that
|
2014-10-16 18:22:44 +02:00
|
|
|
# are in $opts. The source directory must be set in srcdir. The function must
|
2014-11-21 13:19:37 +01:00
|
|
|
# be defined as "runtest()" not "function runtest()" in order to run on
|
2014-10-16 18:22:44 +02:00
|
|
|
# Solaris.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2014-10-16 18:22:44 +02:00
|
|
|
runtest()
|
2014-05-13 13:20:03 +02:00
|
|
|
{
|
2014-10-15 17:57:49 +02:00
|
|
|
rm -f $srcdir/pcre2test $srcdir/pcre2grep $srcdir/pcre2_jit_test
|
2014-05-13 13:20:03 +02:00
|
|
|
testcount=`expr $testcount + 1`
|
|
|
|
|
|
|
|
if [ "$opts" = "" ] ; then
|
|
|
|
echo "[$testcount/$testtotal] Configuring with: default settings"
|
|
|
|
else
|
|
|
|
echo "[$testcount/$testtotal] Configuring with:"
|
|
|
|
echo " $opts"
|
|
|
|
fi
|
|
|
|
|
2016-01-30 17:00:55 +01:00
|
|
|
if [ $dummy -eq 1 ]; then return; fi
|
|
|
|
|
2014-08-10 18:09:24 +02:00
|
|
|
CFLAGS="$CFLAGS" \
|
2015-09-11 18:56:47 +02:00
|
|
|
$srcdir/configure $opts >/dev/null 2>teststderrM
|
2014-05-13 13:20:03 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo " "
|
2014-08-10 18:09:24 +02:00
|
|
|
echo "******** Error while configuring ********"
|
2015-09-11 18:56:47 +02:00
|
|
|
cat teststderrM
|
2014-05-13 13:20:03 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-10-17 20:31:29 +02:00
|
|
|
# There is an infelicity in the Autotools world (as of October 2015) which
|
|
|
|
# causes the message
|
|
|
|
#
|
|
|
|
# ar: `u' modifier ignored since `D' is the default (see `U')
|
2015-12-15 19:20:50 +01:00
|
|
|
#
|
2015-10-17 20:31:29 +02:00
|
|
|
# to be output while linking. This triggers an unwanted error report from this
|
|
|
|
# script, because it expects no stderr output while making. To get round this
|
|
|
|
# we filter the stderr output through sed, removing all occurrences of the
|
|
|
|
# above lines. Just for paranoia, check that sed is available before doing
|
|
|
|
# this.
|
2015-12-15 19:20:50 +01:00
|
|
|
|
2014-05-13 13:20:03 +02:00
|
|
|
echo "Making"
|
2015-09-11 18:56:47 +02:00
|
|
|
make -j >/dev/null 2>teststderrM
|
2015-12-15 19:20:50 +01:00
|
|
|
makeRC=$?
|
2015-10-17 20:31:29 +02:00
|
|
|
if command -v sed >/dev/null 2>&1 ; then
|
|
|
|
sed "/\`u' modifier ignored since \`D' is the default/ d" \
|
|
|
|
teststderrM > teststderrMM
|
2015-12-15 19:20:50 +01:00
|
|
|
mv -f teststderrMM teststderrM
|
2015-10-17 20:31:29 +02:00
|
|
|
fi
|
2015-10-27 17:15:25 +01:00
|
|
|
if [ $makeRC -ne 0 -o -s teststderrM ]; then
|
2014-05-13 13:20:03 +02:00
|
|
|
echo " "
|
2014-08-10 18:09:24 +02:00
|
|
|
echo "******** Errors or warnings while making ********"
|
2014-05-13 13:20:03 +02:00
|
|
|
echo " "
|
2015-09-11 18:56:47 +02:00
|
|
|
cat teststderrM
|
2014-05-13 13:20:03 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $verbose -eq 1 ]; then
|
|
|
|
./pcre2test -C
|
|
|
|
fi
|
|
|
|
|
2014-08-10 18:09:24 +02:00
|
|
|
./pcre2test -C jit >/dev/null
|
2014-05-13 13:20:03 +02:00
|
|
|
jit=$?
|
2014-10-17 17:52:57 +02:00
|
|
|
./pcre2test -C pcre2-8 >/dev/null
|
2014-10-15 17:57:49 +02:00
|
|
|
pcre2_8=$?
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2015-09-08 19:01:17 +02:00
|
|
|
echo "Running PCRE2 library tests $withvalgrind"
|
2015-09-11 18:56:47 +02:00
|
|
|
$srcdir/RunTest $valgrind >teststdoutM 2>teststderrM
|
|
|
|
|
|
|
|
if [ $? -ne 0 -o -s teststderrM ]; then
|
2015-09-08 19:01:17 +02:00
|
|
|
echo " "
|
|
|
|
echo "**** Test failed ****"
|
2015-09-11 18:56:47 +02:00
|
|
|
if [ -s teststderrM ] ; then
|
|
|
|
cat teststderrM
|
|
|
|
else
|
|
|
|
cat teststdoutM
|
|
|
|
fi
|
2015-09-08 19:01:17 +02:00
|
|
|
exit 1
|
2014-05-13 13:20:03 +02:00
|
|
|
fi
|
|
|
|
|
2015-09-08 19:01:17 +02:00
|
|
|
if [ $pcre2_8 -gt 0 ]; then
|
2014-05-13 13:20:03 +02:00
|
|
|
echo "Running pcre2grep tests $withvalgrind"
|
2015-09-11 18:56:47 +02:00
|
|
|
$srcdir/RunGrepTest $valgrind >teststdoutM 2>teststderrM
|
|
|
|
if [ $? -ne 0 -o -s teststderrM ]; then
|
2014-05-13 13:20:03 +02:00
|
|
|
echo " "
|
|
|
|
echo "**** Test failed ****"
|
2015-09-11 18:56:47 +02:00
|
|
|
cat teststderrM
|
|
|
|
cat teststdoutM
|
2014-05-13 13:20:03 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2014-11-21 13:19:37 +01:00
|
|
|
else
|
2015-09-08 19:01:17 +02:00
|
|
|
echo "Skipping pcre2grep tests: 8-bit library not compiled"
|
2014-05-13 13:20:03 +02:00
|
|
|
fi
|
|
|
|
|
2014-11-18 19:32:12 +01:00
|
|
|
if [ "$jit" -gt 0 ]; then
|
2014-05-13 13:20:03 +02:00
|
|
|
echo "Running JIT regression tests $withvalgrind"
|
2016-06-29 18:43:02 +02:00
|
|
|
$jrvalgrind $srcdir/pcre2_jit_test >teststdoutM 2>teststderrM
|
2015-09-11 18:56:47 +02:00
|
|
|
if [ $? -ne 0 -o -s teststderrM ]; then
|
2014-05-13 13:20:03 +02:00
|
|
|
echo " "
|
|
|
|
echo "**** Test failed ****"
|
2015-09-11 18:56:47 +02:00
|
|
|
cat teststderrM
|
|
|
|
cat teststdoutM
|
2014-05-13 13:20:03 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
2014-11-18 19:32:12 +01:00
|
|
|
echo "Skipping JIT regression tests: JIT is not enabled"
|
2014-05-13 13:20:03 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Update the total count whenever a new test is added; it is used to show
|
|
|
|
# progess as each test is run.
|
|
|
|
|
2017-03-09 19:25:55 +01:00
|
|
|
testtotal=`expr 17 \* $usemain + \
|
2015-05-17 18:11:40 +02:00
|
|
|
1 \* $usemain \* $usedebug + \
|
2014-08-10 18:09:24 +02:00
|
|
|
1 \* $usetmp + \
|
2015-04-15 18:12:51 +02:00
|
|
|
1 \* $ISGCC \* $usemain + \
|
|
|
|
1 \* $ISGCC \* $usemain \* $useasan + \
|
2015-05-17 18:11:40 +02:00
|
|
|
1 \* $ISGCC \* $usemain \* $useusan + \
|
2014-08-10 18:09:24 +02:00
|
|
|
13 \* $usejit + \
|
2017-03-09 19:25:55 +01:00
|
|
|
2 \* $usemainvalgrind + \
|
2015-09-11 18:56:47 +02:00
|
|
|
2 \* $usejitvalgrind`
|
|
|
|
|
2014-05-13 13:20:03 +02:00
|
|
|
testcount=0
|
|
|
|
|
2015-09-11 18:56:47 +02:00
|
|
|
if [ $testtotal -eq 0 ] ; then
|
|
|
|
echo "** No tests selected"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2014-05-13 13:20:03 +02:00
|
|
|
valgrind=
|
2016-06-29 18:43:02 +02:00
|
|
|
jrvalgrind=
|
2014-05-13 13:20:03 +02:00
|
|
|
withvalgrind=
|
|
|
|
srcdir=.
|
|
|
|
export srcdir
|
|
|
|
|
2015-05-28 18:48:42 +02:00
|
|
|
if [ $usejit -ne 0 ]; then
|
|
|
|
enable_jit=--enable-jit
|
|
|
|
else
|
|
|
|
enable_jit=
|
|
|
|
fi
|
|
|
|
|
2014-05-13 13:20:03 +02:00
|
|
|
# If gcc is in use, run a maximally configured test with -O2, because that can
|
2014-11-21 13:19:37 +01:00
|
|
|
# throw up warnings that are not detected with -O0. Then run a second test with
|
|
|
|
# -fsanitize=address, which also may throw up new warnings as well as checking
|
2017-03-09 19:25:55 +01:00
|
|
|
# things at runtime. Finally, run another test using -fsanitize=undefined
|
|
|
|
# -std-gnu99 to check for runtime actions that are not well defined. However,
|
|
|
|
# we also use -fno-sanitize=shift to avoid warnings for shifts of negative
|
|
|
|
# numbers, which occur in src/pcre2_jit_compile.c.
|
2014-08-10 18:09:24 +02:00
|
|
|
|
|
|
|
if [ $ISGCC -ne 0 -a $usemain -ne 0 ]; then
|
|
|
|
echo "---------- Maximally configured test with -O2 ----------"
|
2014-11-21 13:19:37 +01:00
|
|
|
SAVECFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="-O2 $CFLAGS"
|
|
|
|
echo "CFLAGS=$CFLAGS"
|
2014-11-03 19:27:56 +01:00
|
|
|
opts="--disable-shared $enable_jit --enable-pcre2-16 --enable-pcre2-32"
|
2014-05-13 13:20:03 +02:00
|
|
|
runtest
|
2015-04-15 18:12:51 +02:00
|
|
|
if [ $useasan -ne 0 ]; then
|
|
|
|
echo "---------- Maximally configured test with -fsanitize=address ----------"
|
2017-08-15 12:58:32 +02:00
|
|
|
# Following a kernel change, sanitize address doesn't work unless the extra
|
|
|
|
# PIE options are also set.
|
|
|
|
CFLAGS="$OFLAGS $SAVECFLAGS -no-pie -fno-PIE -fsanitize=address"
|
2015-04-15 18:12:51 +02:00
|
|
|
echo "CFLAGS=$CFLAGS"
|
2017-03-09 19:25:55 +01:00
|
|
|
opts="--disable-shared $enable_jit --enable-pcre2-16 --enable-pcre2-32"
|
2015-04-15 18:12:51 +02:00
|
|
|
runtest
|
|
|
|
fi
|
2015-05-17 18:11:40 +02:00
|
|
|
if [ $useusan -ne 0 ]; then
|
2015-07-02 15:18:14 +02:00
|
|
|
echo "------- Maximally configured test with -fsanitize=undefined -fno-sanitize=shift -fno-sanitize=alignment -std=gnu99 -------"
|
|
|
|
CFLAGS="$OFLAGS $SAVECFLAGS -fsanitize=undefined -fno-sanitize=shift -fno-sanitize=alignment -std=gnu99"
|
2015-05-17 18:11:40 +02:00
|
|
|
echo "CFLAGS=$CFLAGS"
|
2017-03-09 19:25:55 +01:00
|
|
|
opts="--disable-shared $enable_jit --enable-pcre2-16 --enable-pcre2-32"
|
2015-05-17 18:11:40 +02:00
|
|
|
runtest
|
|
|
|
fi
|
2014-11-21 13:19:37 +01:00
|
|
|
CFLAGS="$OFLAGS $SAVECFLAGS"
|
2014-05-13 13:20:03 +02:00
|
|
|
fi
|
|
|
|
|
2015-05-28 18:48:42 +02:00
|
|
|
# This set of tests builds PCRE2 and runs the tests with a variety of configure
|
|
|
|
# options, in the current (source) directory. The empty configuration builds
|
|
|
|
# with all the default settings. As well as testing that these options work, we
|
|
|
|
# use --disable-shared or --disable-static except for the default test (which
|
|
|
|
# builds both) to save a bit of time by building only one version of the
|
|
|
|
# library for the subsequent tests.
|
|
|
|
|
2014-11-21 13:19:37 +01:00
|
|
|
echo "---------- CFLAGS for the remaining tests ----------"
|
|
|
|
echo "CFLAGS=$CFLAGS"
|
|
|
|
|
2014-08-10 18:09:24 +02:00
|
|
|
if [ $usemain -ne 0 ]; then
|
2015-05-17 18:11:40 +02:00
|
|
|
if [ $usedebug -ne 0 ]; then
|
|
|
|
echo "---------- Maximally configured test with --enable-debug ----------"
|
|
|
|
opts="--disable-shared $enable_jit --enable-pcre2-16 --enable-pcre2-32 --enable-debug"
|
|
|
|
runtest
|
2015-09-11 18:56:47 +02:00
|
|
|
fi
|
2015-04-24 13:14:47 +02:00
|
|
|
|
2014-08-10 18:09:24 +02:00
|
|
|
echo "---------- Non-JIT tests in the current directory ----------"
|
|
|
|
for opts in \
|
|
|
|
"" \
|
2014-11-03 19:27:56 +01:00
|
|
|
"--disable-static" \
|
|
|
|
"--disable-shared" \
|
2017-03-09 19:25:55 +01:00
|
|
|
"--disable-unicode --disable-shared --enable-never-backslash-C" \
|
2016-04-01 17:52:08 +02:00
|
|
|
"--with-link-size=3 --disable-shared --disable-pcre2grep-callout" \
|
2014-11-03 19:27:56 +01:00
|
|
|
"--disable-unicode --enable-rebuild-chartables --disable-shared" \
|
|
|
|
"--disable-unicode --enable-newline-is-any --disable-shared" \
|
|
|
|
"--disable-unicode --enable-newline-is-cr --disable-shared" \
|
|
|
|
"--disable-unicode --enable-newline-is-crlf --disable-shared" \
|
|
|
|
"--disable-unicode --enable-newline-is-anycrlf --enable-bsr-anycrlf --disable-shared" \
|
2017-03-09 19:25:55 +01:00
|
|
|
"--enable-newline-is-any --disable-static" \
|
2014-11-03 19:27:56 +01:00
|
|
|
"--disable-unicode --enable-pcre2-16" \
|
2017-03-09 19:25:55 +01:00
|
|
|
"--enable-pcre2-16 --disable-shared" \
|
2014-11-03 19:27:56 +01:00
|
|
|
"--disable-unicode --enable-pcre2-32" \
|
2017-03-09 19:25:55 +01:00
|
|
|
"--enable-pcre2-32 --disable-shared" \
|
2014-11-03 19:27:56 +01:00
|
|
|
"--disable-unicode --enable-pcre2-32 --enable-pcre2-16 --disable-shared" \
|
|
|
|
"--disable-unicode --enable-pcre2-32 --enable-pcre2-16 --disable-pcre2-8 --disable-shared"
|
2014-08-10 18:09:24 +02:00
|
|
|
do
|
|
|
|
runtest
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Now run the JIT tests unless disabled
|
|
|
|
|
|
|
|
if [ $usejit -ne 0 ]; then
|
|
|
|
echo "---------- JIT tests in the current directory ----------"
|
|
|
|
for opts in \
|
2014-11-03 19:27:56 +01:00
|
|
|
"--disable-unicode --enable-jit --disable-shared" \
|
2014-08-10 18:09:24 +02:00
|
|
|
"--enable-jit --disable-shared" \
|
2014-11-03 19:27:56 +01:00
|
|
|
"--enable-jit --with-link-size=3 --disable-shared" \
|
|
|
|
"--enable-jit --enable-pcre2-16 --disable-shared" \
|
|
|
|
"--disable-unicode --enable-jit --enable-pcre2-16 --disable-pcre2-8 --disable-shared" \
|
2014-10-17 17:52:57 +02:00
|
|
|
"--enable-jit --enable-pcre2-16 --disable-pcre2-8 --disable-shared" \
|
2014-11-03 19:27:56 +01:00
|
|
|
"--enable-jit --enable-pcre2-16 --with-link-size=3 --disable-shared" \
|
|
|
|
"--enable-jit --enable-pcre2-16 --with-link-size=4 --disable-shared" \
|
|
|
|
"--enable-jit --enable-pcre2-32 --disable-shared" \
|
|
|
|
"--disable-unicode --enable-jit --enable-pcre2-32 --disable-pcre2-8 --disable-shared" \
|
2014-10-17 17:52:57 +02:00
|
|
|
"--enable-jit --enable-pcre2-32 --disable-pcre2-8 --disable-shared" \
|
2014-11-03 19:27:56 +01:00
|
|
|
"--enable-jit --enable-pcre2-32 --with-link-size=4 --disable-shared" \
|
|
|
|
"--enable-jit --enable-pcre2-32 --enable-pcre2-16 --disable-pcre2-8 --enable-newline-is-anycrlf --enable-bsr-anycrlf --disable-shared"
|
2014-08-10 18:09:24 +02:00
|
|
|
do
|
|
|
|
runtest
|
|
|
|
done
|
|
|
|
fi
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
# Now re-run some of the tests under valgrind.
|
|
|
|
|
2014-08-10 18:09:24 +02:00
|
|
|
if [ $usevalgrind -ne 0 ]; then
|
|
|
|
echo "---------- Tests in the current directory using valgrind ----------"
|
|
|
|
valgrind=valgrind
|
|
|
|
withvalgrind="with valgrind"
|
|
|
|
|
2015-09-11 18:56:47 +02:00
|
|
|
if [ $usemainvalgrind -ne 0 ]; then
|
|
|
|
for opts in \
|
2017-03-09 19:25:55 +01:00
|
|
|
"--disable-shared" \
|
|
|
|
"--with-link-size=3 --enable-pcre2-16 --enable-pcre2-32 --disable-shared"
|
2015-09-11 18:56:47 +02:00
|
|
|
do
|
|
|
|
opts="--enable-valgrind $opts"
|
|
|
|
runtest
|
|
|
|
done
|
|
|
|
fi
|
2014-08-10 18:09:24 +02:00
|
|
|
|
2015-09-11 18:56:47 +02:00
|
|
|
if [ $usejitvalgrind -ne 0 ]; then
|
2016-06-29 18:43:02 +02:00
|
|
|
jrvalgrind="valgrind --tool=memcheck -q --smc-check=all-non-file --suppressions=$srcdir/testdata/valgrind-jit.supp"
|
2014-08-10 18:09:24 +02:00
|
|
|
for opts in \
|
2014-11-03 19:27:56 +01:00
|
|
|
"--enable-jit --disable-shared" \
|
|
|
|
"--enable-jit --enable-pcre2-16 --enable-pcre2-32"
|
2014-08-10 18:09:24 +02:00
|
|
|
do
|
|
|
|
opts="--enable-valgrind $opts"
|
|
|
|
runtest
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
valgrind=
|
2016-06-29 18:43:02 +02:00
|
|
|
jrvalgrind=
|
2014-05-13 13:20:03 +02:00
|
|
|
withvalgrind=
|
|
|
|
|
|
|
|
# Clean up the distribution and then do at least one build and test in a
|
|
|
|
# directory other than the source directory. It doesn't work unless the
|
|
|
|
# source directory is cleaned up first.
|
|
|
|
|
|
|
|
if [ -f Makefile ]; then
|
|
|
|
echo "Running 'make distclean'"
|
|
|
|
make distclean >/dev/null 2>&1
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "** 'make distclean' failed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2015-12-15 19:20:50 +01:00
|
|
|
echo "---------- End of tests in the source directory ----------"
|
|
|
|
echo "Removing teststdoutM and teststderrM"
|
|
|
|
rm -rf teststdoutM teststderrM
|
|
|
|
|
2015-09-11 18:56:47 +02:00
|
|
|
if [ $usetmp -ne 0 ]; then
|
|
|
|
echo "---------- Tests in the $tmp directory ----------"
|
|
|
|
srcdir=`pwd`
|
|
|
|
export srcdir
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2015-09-11 18:56:47 +02:00
|
|
|
if [ ! -e $tmp ]; then
|
|
|
|
mkdir $tmp
|
|
|
|
fi
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2015-09-11 18:56:47 +02:00
|
|
|
if [ ! -d $tmp ]; then
|
|
|
|
echo "** Failed to create $tmp or it is not a directory"
|
|
|
|
exit 1
|
|
|
|
fi
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2015-09-11 18:56:47 +02:00
|
|
|
cd $tmp
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "** Failed to cd to $tmp"
|
|
|
|
exit 1
|
|
|
|
fi
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2014-08-10 18:09:24 +02:00
|
|
|
for opts in \
|
2014-11-03 19:27:56 +01:00
|
|
|
"--disable-shared"
|
2014-08-10 18:09:24 +02:00
|
|
|
do
|
|
|
|
runtest
|
|
|
|
done
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2015-12-15 19:20:50 +01:00
|
|
|
echo "Removing $tmp"
|
|
|
|
rm -rf $tmp
|
|
|
|
fi
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2015-12-15 19:20:50 +01:00
|
|
|
echo "---------- All done ----------"
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
# End
|