[Pcre-svn] [838] code/trunk: Add -C newline to pcretest; up…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [838] code/trunk: Add -C newline to pcretest; update ManyConfigTests to use new -C features; add
Revision: 838
          http://vcs.pcre.org/viewvc?view=rev&revision=838
Author:   ph10
Date:     2011-12-29 18:27:07 +0000 (Thu, 29 Dec 2011)


Log Message:
-----------
Add -C newline to pcretest; update ManyConfigTests to use new -C features; add
some 16-bit tests with link sizes 3 and 4.

Modified Paths:
--------------
    code/trunk/maint/ManyConfigTests
    code/trunk/pcretest.c


Modified: code/trunk/maint/ManyConfigTests
===================================================================
--- code/trunk/maint/ManyConfigTests    2011-12-29 17:25:26 UTC (rev 837)
+++ code/trunk/maint/ManyConfigTests    2011-12-29 18:27:07 UTC (rev 838)
@@ -64,10 +64,11 @@
     ./pcretest -C
   fi


- conf=`./pcretest -C`
- nl=`expr match "$conf" ".*Newline sequence is \([A-Z]*\)"`
- jit=`expr match "$conf" ".*[^o] Just-in-time"`
- utf8=`expr match "$conf" ".*[^o] UTF-8 support"`
+ nl=`./pcretest -C newline`
+ ./pcretest -C jit >/dev/null
+ jit=$?
+ ./pcretest -C utf >/dev/null
+ utf=$?

   if [ "$nl" = "LF" -o "$nl" = "ANY" ]; then
     echo "Running C library tests $withvalgrind"
@@ -96,7 +97,7 @@
     echo "Skipping pcregrep tests: newline is $nl"
   fi


-  if [ "$jit" -gt 0 -a $utf8 -gt 0 ]; then
+  if [ "$jit" -gt 0 -a $utf -gt 0 ]; then
     echo "Running JIT regression tests $withvalgrind"
     $cvalgrind $srcdir/pcre_jit_test >teststdout 2>teststderr
     if [ $? -ne 0 ]; then
@@ -107,7 +108,7 @@
       exit 1
     fi
   else
-    echo "Skipping JIT regression tests: JIT or UTF-8 not enabled"
+    echo "Skipping JIT regression tests: JIT or UTF not enabled"
   fi


if [ "$nl" = "LF" -o "$nl" = "ANY" ]; then
@@ -170,7 +171,9 @@
"--enable-pcre16 --enable-jit --disable-pcre8 --disable-shared" \
"--enable-pcre16 --enable-jit --disable-pcre8 --enable-utf --disable-shared" \
"--enable-pcre16 --disable-stack-for-recursion --disable-shared" \
- "--enable-pcre16 --enable-unicode-properties --disable-stack-for-recursion --disable-shared"
+ "--enable-pcre16 --enable-unicode-properties --disable-stack-for-recursion --disable-shared" \
+ "--enable-pcre16 --enable-jit --enable-unicode-properties --with-link-size=3 --disable-shared" \
+ "--enable-pcre16 --enable-jit --enable-unicode-properties --with-link-size=4 --disable-shared"
do
runtest
done
@@ -186,7 +189,7 @@
"--enable-unicode-properties --disable-stack-for-recursion --disable-shared" \
"--enable-unicode-properties --with-link-size=3 --disable-shared" \
"--enable-jit --enable-unicode-properties --disable-shared" \
- "--enable-pcre16 --enable-jit --enable-unicode-properties --disable-shared"
+ "--enable-pcre16 --enable-jit --enable-unicode-properties --disable-shared"
do
runtest
done

Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2011-12-29 17:25:26 UTC (rev 837)
+++ code/trunk/pcretest.c    2011-12-29 18:27:07 UTC (rev 838)
@@ -2331,7 +2331,18 @@
         yield = rc;
         goto EXIT;
         }
-      printf("Unknown option: %s\n", argv[op + 1]);
+      if (strcmp(argv[op + 1], "newline") == 0)
+        {   
+        (void)PCRE_CONFIG(PCRE_CONFIG_NEWLINE, &rc);
+        /* Note that these values are always the ASCII values, even
+        in EBCDIC environments. CR is 13 and NL is 10. */
+        printf("%s\n", (rc == 13)? "CR" :
+          (rc == 10)? "LF" : (rc == (13<<8 | 10))? "CRLF" :
+          (rc == -2)? "ANYCRLF" :
+          (rc == -1)? "ANY" : "???");
+        goto EXIT;
+        } 
+      printf("Unknown -C option: %s\n", argv[op + 1]);
       goto EXIT;
       }