summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-05-18 02:06:03 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-05-18 02:06:03 +0000
commitd266c18c0eaae22aa428f8a1f04bbd481d21ef81 (patch)
treeb3c32d7e74b185ec8b293b6e684b3359e8732d17
parent478b8059563418c4319e24c14ce37a51ac2fb35a (diff)
downloadbcm5719-llvm-d266c18c0eaae22aa428f8a1f04bbd481d21ef81.tar.gz
bcm5719-llvm-d266c18c0eaae22aa428f8a1f04bbd481d21ef81.zip
Avoid an infinite loop when TestRunner.sh is run outside of the test dir.
llvm-svn: 37201
-rwxr-xr-xllvm/test/TestRunner.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/test/TestRunner.sh b/llvm/test/TestRunner.sh
index 63e4ea7d6be..d93eda28aab 100755
--- a/llvm/test/TestRunner.sh
+++ b/llvm/test/TestRunner.sh
@@ -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
OpenPOWER on IntegriCloud