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

llvm-svn: 37201
This commit is contained in:
Reid Spencer 2007-05-18 02:06:03 +00:00
parent 478b805956
commit d266c18c0e
1 changed files with 7 additions and 5 deletions

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