[Pcre-svn] [1050] code/trunk: Cut out test of NUL characters…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1050] code/trunk: Cut out test of NUL characters in RunGrepTest for all OS except Linux, as it
Revision: 1050
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1050
Author:   ph10
Date:     2018-12-06 17:05:06 +0000 (Thu, 06 Dec 2018)
Log Message:
-----------
Cut out test of NUL characters in RunGrepTest for all OS except Linux, as it 
doesn't work for *BSD as well as for Solaris and MacOS (which were already cut 
out).


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/RunGrepTest


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2018-11-27 16:41:20 UTC (rev 1049)
+++ code/trunk/ChangeLog    2018-12-06 17:05:06 UTC (rev 1050)
@@ -88,7 +88,12 @@
 22. If a pattern started with (*MARK), (*COMMIT), (*PRUNE), (*SKIP), or (*THEN) 
 followed by ^ it was not recognized as anchored.


+23. The RunGrepTest script used to cut out the test of NUL characters for
+Solaris and MacOS as printf and sed can't handle them. It seems that the *BSD
+systems can't either. I've inverted the test so that only those OS that are
+known to work (currently only Linux) try to run this test.

+
Version 10.32 10-September-2018
-------------------------------


Modified: code/trunk/RunGrepTest
===================================================================
--- code/trunk/RunGrepTest    2018-11-27 16:41:20 UTC (rev 1049)
+++ code/trunk/RunGrepTest    2018-12-06 17:05:06 UTC (rev 1050)
@@ -714,20 +714,24 @@
 printf '%c--------------------------- Test N6 ------------------------------\r\n' - >>testtrygrep
 $valgrind $vjs $pcre2grep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep


-# It seems impossible to handle NUL characters easily in Solaris (aka SunOS).
-# The version of sed explicitly doesn't like them. For the moment, we just
-# don't run this test under SunOS. Fudge the output so that the comparison
-# works. A similar problem has also been reported for MacOS (Darwin).
+# It seems impossible to handle NUL characters easily in many operating
+# systems, including Solaris (aka SunOS), where the version of sed explicitly
+# doesn't like them, and also MacOS (Darwin), OpenBSD, FreeBSD, and NetBSD. So
+# now we run this test only on OS that are known to work. For the rest, we
+# fudge the output so that the comparison works.

 printf '%c--------------------------- Test N7 ------------------------------\r\n' - >>testtrygrep
 uname=`uname`
-if [ "$uname" != "SunOS" -a "$uname" != "Darwin" ] ; then
-  printf 'abc\0def' >testNinputgrep
-  $valgrind $vjs $pcre2grep -na --newline=nul "^(abc|def)" testNinputgrep | sed 's/\x00/ZERO/' >>testtrygrep
-  echo "" >>testtrygrep
-else
-  echo '1:abcZERO2:def' >>testtrygrep
-fi
+case $uname in
+  Linux)
+    printf 'abc\0def' >testNinputgrep
+    $valgrind $vjs $pcre2grep -na --newline=nul "^(abc|def)" testNinputgrep | sed 's/\x00/ZERO/' >>testtrygrep
+    echo "" >>testtrygrep
+    ;;
+  *)
+    echo '1:abcZERO2:def' >>testtrygrep
+    ;;
+esac


$cf $srcdir/testdata/grepoutputN testtrygrep
if [ $? != 0 ] ; then exit 1; fi