Revision: 1450
http://vcs.pcre.org/viewvc?view=rev&revision=1450
Author: ph10
Date: 2014-01-17 17:50:51 +0000 (Fri, 17 Jan 2014)
Log Message:
-----------
Fix bug in tests when 16/32 bits and --enable-bsr-anycrlf are both set. Extend
pcretest to show the \R default.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/doc/pcretest.1
code/trunk/maint/ManyConfigTests
code/trunk/pcretest.c
code/trunk/testdata/testinput18
code/trunk/testdata/testoutput18-16
code/trunk/testdata/testoutput18-32
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2014-01-17 16:59:52 UTC (rev 1449)
+++ code/trunk/ChangeLog 2014-01-17 17:50:51 UTC (rev 1450)
@@ -86,6 +86,13 @@
provokes an error. The invalid example in README has been corrected.
If a value less than the minimum is given, the minimum value has always
been used, but now a warning is given.
+
+17. If --enable-bsr-anycrlf was set, the special 16/32-bit test failed. This
+ was a bug in the test system, which is now fixed. Also, the list of various
+ configurations that are tested for each release did not have one with both
+ 16/32 bits and --enable-bar-anycrlf. It now does.
+
+18. pcretest was missing "-C bsr" for displaying the \R default setting.
Version 8.34 15-December-2013
Modified: code/trunk/doc/pcretest.1
===================================================================
--- code/trunk/doc/pcretest.1 2014-01-17 16:59:52 UTC (rev 1449)
+++ code/trunk/doc/pcretest.1 2014-01-17 17:50:51 UTC (rev 1450)
@@ -1,4 +1,4 @@
-.TH PCRETEST 1 "03 January 2014" "PCRE 8.35"
+.TH PCRETEST 1 "17 January 2014" "PCRE 8.35"
.SH NAME
pcretest - a program for testing Perl-compatible regular expressions.
.SH SYNOPSIS
@@ -113,6 +113,9 @@
newline the default newline setting:
CR, LF, CRLF, ANYCRLF, or ANY
exit code is always 0
+ bsr the default setting for what \eR matches:
+ ANYCRLF or ANY
+ exit code is always 0
.sp
The following options output 1 for true or 0 for false, and set the exit code
to the same value:
@@ -1138,6 +1141,6 @@
.rs
.sp
.nf
-Last updated: 03 January 2014
+Last updated: 17 January 2014
Copyright (c) 1997-2014 University of Cambridge.
.fi
Modified: code/trunk/maint/ManyConfigTests
===================================================================
--- code/trunk/maint/ManyConfigTests 2014-01-17 16:59:52 UTC (rev 1449)
+++ code/trunk/maint/ManyConfigTests 2014-01-17 17:50:51 UTC (rev 1450)
@@ -39,7 +39,7 @@
ISGCC="yes"
CFLAGS="$CFLAGS -Wall"
CFLAGS="$CFLAGS -Wno-overlength-strings"
- CFLAGS="$CFLAGS -Wpointer-arith"
+ CFLAGS="$CFLAGS -Wpointer-arith"
CFLAGS="$CFLAGS -Wwrite-strings"
CFLAGS="$CFLAGS -Wundef -Wshadow"
CFLAGS="$CFLAGS -Wextra -Wformat"
@@ -50,7 +50,7 @@
CFLAGS="$CFLAGS -Wuninitialized"
CFLAGS="$CFLAGS -Wmissing-prototypes"
CFLAGS="$CFLAGS -Wstrict-prototypes"
-fi
+fi
# This function runs a single test with the set of configuration options that
@@ -59,7 +59,7 @@
function runtest()
{
rm -f *_unittest
- testcount=`expr $testcount + 1`
+ testcount=`expr $testcount + 1`
if [ "$opts" = "" ] ; then
echo "[$testcount/$testtotal] Configuring with: default settings"
@@ -70,7 +70,7 @@
CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
$srcdir/configure $opts >/dev/null 2>teststderr
-
+
if [ $? -ne 0 ]; then
echo " "
echo "**** Error while configuring ****"
@@ -83,7 +83,7 @@
if [ $? -ne 0 -o -s teststderr ]; then
echo " "
echo "**** Errors or warnings while making ****"
- echo " "
+ echo " "
cat teststderr
exit 1
fi
@@ -189,9 +189,9 @@
echo "Maximally configured test with -O2"
SAVECLFAGS="$CFLAGS"
CFLAGS="$CFLAGS -O2"
- opts="--disable-shared --enable-unicode-properties --enable-jit --enable-pcre16 --enable-pcre32"
+ opts="--disable-shared --enable-unicode-properties --enable-jit --enable-pcre16 --enable-pcre32"
runtest
- CFLAGS="$SAVECFLAGS"
+ CFLAGS="$SAVECFLAGS"
fi
echo "General tests in the current directory"
@@ -230,7 +230,8 @@
"--enable-pcre32 --enable-unicode-properties --disable-stack-for-recursion --disable-shared" \
"--enable-pcre32 --enable-jit --enable-unicode-properties --with-link-size=4 --disable-shared" \
"--enable-pcre32 --enable-pcre16 --disable-shared" \
- "--enable-pcre32 --enable-pcre16 --disable-pcre8 --disable-shared"
+ "--enable-pcre32 --enable-pcre16 --disable-pcre8 --disable-shared" \
+ "--enable-pcre32 --enable-pcre16 --disable-pcre8 --enable-jit --enable-unicode-properties --enable-newline-is-anycrlf --enable-bsr-anycrlf --disable-shared"
do
runtest
done
Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c 2014-01-17 16:59:52 UTC (rev 1449)
+++ code/trunk/pcretest.c 2014-01-17 17:50:51 UTC (rev 1450)
@@ -2883,8 +2883,8 @@
#endif
printf(" -b show compiled code\n");
printf(" -C show PCRE compile-time options and exit\n");
-printf(" -C arg show a specific compile-time option\n");
-printf(" and exit with its value. The arg can be:\n");
+printf(" -C arg show a specific compile-time option and exit\n");
+printf(" with its value if numeric (else 0). The arg can be:\n");
printf(" linksize internal link size [2, 3, 4]\n");
printf(" pcre8 8 bit library support enabled [0, 1]\n");
printf(" pcre16 16 bit library support enabled [0, 1]\n");
@@ -2892,7 +2892,8 @@
printf(" utf Unicode Transformation Format supported [0, 1]\n");
printf(" ucp Unicode Properties supported [0, 1]\n");
printf(" jit Just-in-time compiler supported [0, 1]\n");
-printf(" newline Newline type [CR, LF, CRLF, ANYCRLF, ANY, ???]\n");
+printf(" newline Newline type [CR, LF, CRLF, ANYCRLF, ANY]\n");
+printf(" bsr \\R type [ANYCRLF, ANY]\n");
printf(" -d debug: show compiled code and information (-b and -i)\n");
#if !defined NODFA
printf(" -dfa force DFA matching for all subjects\n");
@@ -3231,6 +3232,11 @@
(void)PCRE_CONFIG(PCRE_CONFIG_NEWLINE, &rc);
print_newline_config(rc, TRUE);
}
+ else if (strcmp(argv[op + 1], "bsr") == 0)
+ {
+ (void)PCRE_CONFIG(PCRE_CONFIG_BSR, &rc);
+ printf("%s\n", rc? "ANYCRLF" : "ANY");
+ }
else if (strcmp(argv[op + 1], "ebcdic") == 0)
{
#ifdef EBCDIC
Modified: code/trunk/testdata/testinput18
===================================================================
--- code/trunk/testdata/testinput18 2014-01-17 16:59:52 UTC (rev 1449)
+++ code/trunk/testdata/testinput18 2014-01-17 17:50:51 UTC (rev 1450)
@@ -207,7 +207,7 @@
CDBABC
\x{2000}ABC
-/\R*A/SI8
+/\R*A/SI8<bsr_unicode>
CDBABC
\x{2028}A
Modified: code/trunk/testdata/testoutput18-16
===================================================================
--- code/trunk/testdata/testoutput18-16 2014-01-17 16:59:52 UTC (rev 1449)
+++ code/trunk/testdata/testoutput18-16 2014-01-17 17:50:51 UTC (rev 1450)
@@ -718,9 +718,9 @@
\x{2000}ABC
0: \x{2000}A
-/\R*A/SI8
+/\R*A/SI8<bsr_unicode>
Capturing subpattern count = 0
-Options: utf
+Options: bsr_unicode utf
No first char
Need char = 'A'
Subject length lower bound = 1
Modified: code/trunk/testdata/testoutput18-32
===================================================================
--- code/trunk/testdata/testoutput18-32 2014-01-17 16:59:52 UTC (rev 1449)
+++ code/trunk/testdata/testoutput18-32 2014-01-17 17:50:51 UTC (rev 1450)
@@ -715,9 +715,9 @@
\x{2000}ABC
0: \x{2000}A
-/\R*A/SI8
+/\R*A/SI8<bsr_unicode>
Capturing subpattern count = 0
-Options: utf
+Options: bsr_unicode utf
No first char
Need char = 'A'
Subject length lower bound = 1