2020# -nomainvalgrind skip the main (non-JIT) valgrind tests
2121# -notmp skip the tests in a temporary directory
2222# -notmpjit skip the JIT test in a temporary directory
23+ # -noebcdic skip the EBCDIC tests
2324# -novalgrind skip all the valgrind tests
2425
2526# Alternatively, if any of those names are given with '+' instead of '-no',
@@ -38,6 +39,7 @@ usemain=1
3839usemainvalgrind=1
3940usetmp=1
4041usetmpjit=1
42+ useebcdic=0 # XXX Set to 1 after fixed on all plats
4143usevalgrind=1
4244
4345dummy=0
@@ -55,8 +57,9 @@ while [ $# -gt 0 ] ; do
5557 usemain=0
5658 usemainvalgrind=0
5759 usetmp=0
58- usetmpjit=0
59- usevalgrind=0
60+ usetmpjit=0
61+ useebcdic=0
62+ usevalgrind=0
6063 seenplus=1
6164 fi ;;
6265 esac
@@ -74,6 +77,7 @@ while [ $# -gt 0 ] ; do
7477 -nomainvalgrind) usemainvalgrind=0;;
7578 -notmp) usetmp=0; usetmpjit=0;;
7679 -notmpjit) usetmpjit=0;;
80+ -noebcdic) useebcdic=0;;
7781 -novalgrind) usevalgrind=0;;
7882 +asan) useasan=1;;
7983 +usan) useusan=1;;
@@ -85,6 +89,7 @@ while [ $# -gt 0 ] ; do
8589 +mainvalgrind) usemainvalgrind=1;;
8690 +tmp) usetmp=1;;
8791 +tmpjit) usetmpjit=1;;
92+ +ebcdic) useebcdic=1;;
8893 +valgrind) usevalgrind=1; usejitvalgrind=1; usemainvalgrind=1;;
8994 * ) echo " Unknown option '$1 '" ; exit 1;;
9095 esac
@@ -221,7 +226,11 @@ runtest()
221226 exit 1
222227 fi
223228
224- if [ $pcre2_8 -gt 0 ]; then
229+ if [ " x$withebcdic " != x ]; then
230+ echo " Skipping pcre2grep and pcre2posix tests: not supported on EBCDIC"
231+ elif [ $pcre2_8 -eq 0 ]; then
232+ echo " Skipping pcre2grep and pcre2posix tests: 8-bit library not compiled"
233+ else
225234 echo " Running pcre2grep tests $withvalgrind "
226235 $srcdir /RunGrepTest $valgrind > teststdoutM 2> teststderrM
227236 if [ $? -ne 0 -o -s teststderrM ]; then
@@ -239,8 +248,6 @@ runtest()
239248 echo " **** Test failed ****"
240249 exit 1
241250 fi
242- else
243- echo " Skipping pcre2grep and pcre2posix tests: 8-bit library not compiled"
244251 fi
245252
246253 if [ " $jit " -gt 0 ]; then
@@ -268,6 +275,7 @@ testtotal=`expr 17 \* $usemain + \
268275 1 \* $ISGCC \* $usemain \* $useasan + \
269276 1 \* $ISGCC \* $usemain \* $useusan + \
270277 13 \* $usejit + \
278+ 2 \* $useebcdic + \
271279 2 \* $usemainvalgrind + \
272280 2 \* $usejitvalgrind `
273281
@@ -388,6 +396,22 @@ if [ $usejit -ne 0 ]; then
388396 done
389397fi
390398
399+ # Now run some tests with EBCDIC enabled
400+
401+ if [ $useebcdic -ne 0 ]; then
402+ echo " ---------- EBCDIC tests in the current directory ----------"
403+ withebcdic=" with EBCDIC"
404+
405+ for opts in \
406+ " --disable-unicode --enable-ebcdic --enable-ebcdic-ignoring-compiler" \
407+ " --disable-unicode --enable-ebcdic --enable-ebcdic-ignoring-compiler --enable-ebcdic-nl25"
408+ do
409+ runtest
410+ done
411+ fi
412+
413+ withebcdic=
414+
391415# Now re-run some of the tests under valgrind.
392416
393417if [ $usevalgrind -ne 0 ]; then
@@ -464,8 +488,8 @@ if [ $usetmp -ne 0 -o $usetmpjit -ne 0 ]; then
464488 do
465489 runtest
466490 done
467- fi
468-
491+ fi
492+
469493 if [ $usetmpjit -ne 0 ]; then
470494 echo " ---------- JIT tests in the $tmp directory ----------"
471495 for opts in \
0 commit comments