summaryrefslogtreecommitdiff
path: root/RunGrepTest
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-09-25 11:04:33 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-09-25 11:04:33 +0000
commit82f54d224bdd237643e7657775b10586b3deffe4 (patch)
tree1fe46ea37f0ba1c35b0ae9d0505c6b14877911b5 /RunGrepTest
parentb9927656e22490fd5c1d7541faf856d4caf21407 (diff)
downloadpcre-82f54d224bdd237643e7657775b10586b3deffe4.tar.gz
Look for testdata in parent directory if not found in current.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@711 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'RunGrepTest')
-rwxr-xr-xRunGrepTest18
1 files changed, 13 insertions, 5 deletions
diff --git a/RunGrepTest b/RunGrepTest
index b70689e..4f26e43 100755
--- a/RunGrepTest
+++ b/RunGrepTest
@@ -41,13 +41,21 @@ else
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