[Pcre-svn] [437] code/trunk: Add test for diff -u to RunGrep…

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [437] code/trunk: Add test for diff -u to RunGrepTest.
Revision: 437
          http://vcs.pcre.org/viewvc?view=rev&revision=437
Author:   ph10
Date:     2009-09-06 17:34:42 +0100 (Sun, 06 Sep 2009)


Log Message:
-----------
Add test for diff -u to RunGrepTest.

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


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2009-09-06 16:23:55 UTC (rev 436)
+++ code/trunk/ChangeLog    2009-09-06 16:34:42 UTC (rev 437)
@@ -100,6 +100,10 @@
     value for \fInmatch\fP with a NULL value for \fIpmatch\fP, the value of
     \fInmatch\fP is forced to zero. 


+18. RunGrepTest did not have a test for the availability of the -u option of
+    the diff command, as RunTest does. It now checks in the same way as 
+    RunTest, and also checks for the -b option.
+    


Version 7.9 11-Apr-09
---------------------

Modified: code/trunk/RunGrepTest
===================================================================
--- code/trunk/RunGrepTest    2009-09-06 16:23:55 UTC (rev 436)
+++ code/trunk/RunGrepTest    2009-09-06 16:34:42 UTC (rev 437)
@@ -14,9 +14,7 @@
 echo "Testing pcregrep"
 $pcregrep -V


-cf="diff -ub"
 valgrind=
-
 while [ $# -gt 0 ] ; do
   case $1 in
     valgrind) valgrind="valgrind -q --leak-check=no";;
@@ -25,6 +23,18 @@
   shift
 done


+cf="diff -ub"
+
+# Set up a suitable "diff" command for comparison. Some systems have a diff
+# that lacks a -u option. Try to deal with this; better do the test for the -b
+# option as well.
+
+if diff -u /dev/null /dev/null; then
+ if diff -ub /dev/null /dev/null; then cf="diff -ub"; else cf="diff -u"; fi
+else
+ if diff -b /dev/null /dev/null; then cf="diff -b"; else cf="diff"; fi
+fi
+
# If PCRE has been built in a directory other than the source directory, and
# this test is being run from "make check" as usual, then $(srcdir) will be
# set. If not, set it to the current directory. We then arrange to run the