diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-05-18 02:06:03 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-05-18 02:06:03 +0000 |
commit | e01236a9bbb895b9ebe02c023aa413f7038e469f (patch) | |
tree | 7b7f3e9deab8118c93604ce4b63544f67afb8b67 /test/TestRunner.sh | |
parent | 47d25020728d23ca62a805963e3b0885a4df1bc6 (diff) |
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
Diffstat (limited to 'test/TestRunner.sh')
-rwxr-xr-x | test/TestRunner.sh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/TestRunner.sh b/test/TestRunner.sh index 63e4ea7d6b..d93eda28aa 100755 --- a/test/TestRunner.sh +++ b/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 |