diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2009-09-06 16:34:42 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2009-09-06 16:34:42 +0000 |
commit | 464fc8e4c9e4dda70242e057f31e930424697c31 (patch) | |
tree | da1c1ad36ea3063f1949b8ba0ade0edcf4fc775f /RunGrepTest | |
parent | fef2b3e58e7cdc180a4f00f155a7ffa8328877ce (diff) | |
download | pcre-464fc8e4c9e4dda70242e057f31e930424697c31.tar.gz |
Add test for diff -u to RunGrepTest.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@437 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'RunGrepTest')
-rwxr-xr-x | RunGrepTest | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/RunGrepTest b/RunGrepTest index 1872e9c..6cbd2cc 100755 --- a/RunGrepTest +++ b/RunGrepTest @@ -14,9 +14,7 @@ echo " " 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 @@ while [ $# -gt 0 ] ; do 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 |