Skip to content

Commit 0746b3d

Browse files
committed
Update the ManyConfigTests to include new POSIX freestanding test, add a JIT test in a non-source directory, and update selectors
1 parent 937964f commit 0746b3d

File tree

2 files changed

+53
-20
lines changed

2 files changed

+53
-20
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ Version 10.43 xx-xxx-202x
99
newline setting didn't include \n as a newline. One test needed (*LF) to ensure
1010
that it worked.
1111

12+
2. Added the new freestanding POSIX test program to the ManyConfigTests script
13+
in the maint directory (overlooked in 2 below). Also improved the selection
14+
facilities in that script, and added a test with JIT in a non-source directory,
15+
fixing an oversight that would have made such a test fail before.
16+
1217

1318
Version 10.42 11-December-2022
1419
------------------------------

maint/ManyConfigTests

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22

3-
# This is a script for the use of PCRE2 maintainers. It configures and rebuilds
3+
# This is a script for the use of PCRE2 maintainers. It configures and builds
44
# PCRE2 with a variety of configuration options, and in each case runs the
55
# tests to ensure that all goes well. Every possible combination would take far
66
# too long, so we use a representative sample. This script should be run in the
@@ -18,7 +18,8 @@
1818
# -nojitvalgrind skip JIT tests with valgrind
1919
# -nomain skip all the main (non-JIT) set of tests
2020
# -nomainvalgrind skip the main (non-JIT) valgrind tests
21-
# -notmp skip the test in a temporary directory
21+
# -notmp skip the tests in a temporary directory
22+
# -notmpjit skip the JIT test in a temporary directory
2223
# -novalgrind skip all the valgrind tests
2324

2425
# Alternatively, if any of those names are given with '+' instead of '-no',
@@ -36,6 +37,7 @@ usejitvalgrind=1
3637
usemain=1
3738
usemainvalgrind=1
3839
usetmp=1
40+
usetmpjit=1
3941
usevalgrind=1
4042

4143
dummy=0
@@ -53,6 +55,8 @@ while [ $# -gt 0 ] ; do
5355
usemain=0
5456
usemainvalgrind=0
5557
usetmp=0
58+
usetmpjit=0
59+
usevalgrind=0
5660
seenplus=1
5761
fi;;
5862
esac
@@ -63,22 +67,24 @@ while [ $# -gt 0 ] ; do
6367
-noasan) useasan=0;;
6468
-nousan) useusan=0;;
6569
-nodebug) usedebug=0;;
66-
-nojit) usejit=0; usejitvalgrind=0;;
70+
-nojit) usejit=0; usejitvalgrind=0; usetmpjit=0;;
6771
-nojitmain) usejit=0;;
6872
-nojitvalgrind) usejitvalgrind=0;;
6973
-nomain) usemain=0; usemainvalgrind=0;;
7074
-nomainvalgrind) usemainvalgrind=0;;
71-
-notmp) usetmp=0;;
75+
-notmp) usetmp=0; usetmpjit=0;;
76+
-notmpjit) usetmpjit=0;;
7277
-novalgrind) usevalgrind=0;;
7378
+asan) useasan=1;;
7479
+usan) useusan=1;;
7580
+debug) usedebug=1;;
76-
+jit) usejit=1; usejitvalgrind=1;;
81+
+jit) usejit=1; usejitvalgrind=1; usetmpjit=1;;
7782
+jitmain) usejit=1;;
7883
+jitvalgrind) usejitvalgrind=1;;
7984
+main) usemain=1; usemainvalgrind=1;;
8085
+mainvalgrind) usemainvalgrind=1;;
8186
+tmp) usetmp=1;;
87+
+tmpjit) usetmpjit=1;;
8288
+valgrind) usevalgrind=1; usejitvalgrind=1; usemainvalgrind=1;;
8389
*) echo "Unknown option '$1'"; exit 1;;
8490
esac
@@ -124,9 +130,11 @@ if [ $? -eq 0 ] && grep GCC /tmp/pcre2ccversion >/dev/null; then
124130
CFLAGS="$CFLAGS -Wnested-externs"
125131
CFLAGS="$CFLAGS -pedantic"
126132
CFLAGS="$CFLAGS -Wuninitialized"
127-
CFLAGS="$CFLAGS -Wmaybe-uninitialized"
133+
CFLAGS="$CFLAGS -Wmaybe-uninitialized"
128134
CFLAGS="$CFLAGS -Wmissing-prototypes"
129135
CFLAGS="$CFLAGS -Wstrict-prototypes"
136+
CFKAGS="$CFLAGS -Warray-bounds"
137+
CFLAGS="$CFLAGS -Wformat-overflow=2"
130138
fi
131139
rm -f /tmp/pcre2ccversion
132140

@@ -137,7 +145,7 @@ rm -f /tmp/pcre2ccversion
137145

138146
runtest()
139147
{
140-
rm -f $srcdir/pcre2test $srcdir/pcre2grep $srcdir/pcre2_jit_test
148+
rm -f $srcdir/pcre2test $srcdir/pcre2grep $srcdir/pcre2_jit_test $srcdir/pcre2posix_test
141149
testcount=`expr $testcount + 1`
142150

143151
if [ "$opts" = "" ] ; then
@@ -218,13 +226,21 @@ runtest()
218226
cat teststdoutM
219227
exit 1
220228
fi
229+
echo "Running pcre2posix test $withvalgrind"
230+
$valgrind ./pcre2posix_test >teststdoutM 2>teststderrM
231+
232+
if [ $? -ne 0 ]; then
233+
echo " "
234+
echo "**** Test failed ****"
235+
exit 1
236+
fi
221237
else
222-
echo "Skipping pcre2grep tests: 8-bit library not compiled"
238+
echo "Skipping pcre2grep and pcre2posix tests: 8-bit library not compiled"
223239
fi
224240

225241
if [ "$jit" -gt 0 ]; then
226242
echo "Running JIT regression tests $withvalgrind"
227-
$jrvalgrind $srcdir/pcre2_jit_test >teststdoutM 2>teststderrM
243+
$jrvalgrind ./pcre2_jit_test >teststdoutM 2>teststderrM
228244
if [ $? -ne 0 -o -s teststderrM ]; then
229245
echo " "
230246
echo "**** Test failed ****"
@@ -242,7 +258,7 @@ runtest()
242258

243259
testtotal=`expr 17 \* $usemain + \
244260
1 \* $usemain \* $usedebug + \
245-
1 \* $usetmp + \
261+
1 \* $usetmp + 1 \* $usetmpjit + \
246262
1 \* $ISGCC \* $usemain + \
247263
1 \* $ISGCC \* $usemain \* $useasan + \
248264
1 \* $ISGCC \* $usemain \* $useusan + \
@@ -293,15 +309,15 @@ if [ $ISGCC -ne 0 -a $usemain -ne 0 ]; then
293309
opts="--disable-shared $enable_jit --enable-pcre2-16 --enable-pcre2-32"
294310
runtest
295311
fi
296-
# This also seems to be the case for sanitize undefined.
312+
# This also seems to be the case for sanitize undefined.
297313
if [ $useusan -ne 0 ]; then
298314
echo "------- Maximally configured test with -fsanitize=undefined -fno-sanitize=shift -fno-sanitize=alignment -std=gnu99 -------"
299315
CFLAGS="$OFLAGS $SAVECFLAGS -no-pie -fno-PIE -fsanitize=undefined -fno-sanitize=shift -fno-sanitize=alignment -std=gnu99"
300316
echo "CFLAGS=$CFLAGS"
301317
opts="--disable-shared $enable_jit --enable-pcre2-16 --enable-pcre2-32"
302318
runtest
303319
fi
304-
CFLAGS="$OFLAGS $SAVECFLAGS"
320+
CFLAGS="$SAVECFLAGS"
305321
fi
306322

307323
# This set of tests builds PCRE2 and runs the tests with a variety of configure
@@ -312,6 +328,7 @@ fi
312328
# library for the subsequent tests.
313329

314330
echo "---------- CFLAGS for the remaining tests ----------"
331+
CFLAGS="$OFLAGS $CFLAGS"
315332
echo "CFLAGS=$CFLAGS"
316333

317334
if [ $usemain -ne 0 ]; then
@@ -386,7 +403,7 @@ if [ $usevalgrind -ne 0 ]; then
386403
fi
387404

388405
if [ $usejitvalgrind -ne 0 ]; then
389-
jrvalgrind="valgrind --tool=memcheck -q --smc-check=all-non-file --suppressions=$srcdir/testdata/valgrind-jit.supp"
406+
jrvalgrind="valgrind --tool=memcheck -q --smc-check=all-non-file --suppressions=$srcdir/testdata/valgrind-jit.supp"
390407
for opts in \
391408
"--enable-jit --disable-shared" \
392409
"--enable-jit --enable-pcre2-16 --enable-pcre2-32"
@@ -418,8 +435,7 @@ echo "---------- End of tests in the source directory ----------"
418435
echo "Removing teststdoutM and teststderrM"
419436
rm -rf teststdoutM teststderrM
420437

421-
if [ $usetmp -ne 0 ]; then
422-
echo "---------- Tests in the $tmp directory ----------"
438+
if [ $usetmp -ne 0 -o $usetmpjit -ne 0 ]; then
423439
srcdir=`pwd`
424440
export srcdir
425441

@@ -438,11 +454,23 @@ if [ $usetmp -ne 0 ]; then
438454
exit 1
439455
fi
440456

441-
for opts in \
442-
"--disable-shared"
443-
do
444-
runtest
445-
done
457+
if [ $usetmp -ne 0 ]; then
458+
echo "---------- Tests in the $tmp directory ----------"
459+
for opts in \
460+
"--disable-shared"
461+
do
462+
runtest
463+
done
464+
fi
465+
466+
if [ $usetmpjit -ne 0 ]; then
467+
echo "---------- JIT tests in the $tmp directory ----------"
468+
for opts in \
469+
"--enable-jit --disable-shared"
470+
do
471+
runtest
472+
done
473+
fi
446474

447475
echo "Removing $tmp"
448476
rm -rf $tmp

0 commit comments

Comments
 (0)