Revision: 711
http://vcs.pcre.org/viewvc?view=rev&revision=711
Author: ph10
Date: 2011-09-25 12:04:33 +0100 (Sun, 25 Sep 2011)
Log Message:
-----------
Look for testdata in parent directory if not found in current.
Modified Paths:
--------------
code/trunk/RunGrepTest
Modified: code/trunk/RunGrepTest
===================================================================
--- code/trunk/RunGrepTest 2011-09-25 10:57:12 UTC (rev 710)
+++ code/trunk/RunGrepTest 2011-09-25 11:04:33 UTC (rev 711)
@@ -41,13 +41,21 @@
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
-# pcregrep command in the source directory so that the file names that appear
-# in the output are always the same.
+# this test is being run from "make check" as usual, then $srcdir will be
+# set. If not, set it to the current or parent directory, whichever one
+# contains the test data. We then arrange to run the pcregrep command in the
+# source directory so that the file names that appear in the output are always
+# the same.
if [ -z "$srcdir" -o ! -d "$srcdir/testdata" ] ; then
- srcdir=.
+ if [ -d "./testdata" ] ; then
+ srcdir=.
+ elif [ -d "../testdata" ] ; then
+ srcdir=..
+ else
+ echo "Cannot find the testdata directory"
+ exit 1
+ fi
fi
# Check for the availability of UTF-8 support