Avoid an infinite loop when TestRunner.sh is run outside of the test dir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37201 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2007-05-18 02:06:03 +00:00
parent 47d2502072
commit e01236a9bb

View File

@ -13,11 +13,13 @@
#
TESTPATH=`pwd`
SUBDIR=""
while test `basename $TESTPATH` != "test" -a ! -z "$TESTPATH" ; do
tmp=`basename $TESTPATH`
SUBDIR="$tmp/$SUBDIR"
TESTPATH=`dirname $TESTPATH`
done
if test `dirname $1` == "." ; then
while test `basename $TESTPATH` != "test" -a ! -z "$TESTPATH" ; do
tmp=`basename $TESTPATH`
SUBDIR="$tmp/$SUBDIR"
TESTPATH=`dirname $TESTPATH`
done
fi
for TESTFILE in "$@" ; do
if test `dirname $TESTFILE` == . ; then