From c619d954e78a066064b32d6923d54c73f9e8aa1c Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 16 May 2007 17:56:56 +0000 Subject: [PATCH] Fix PR1355: Only compute the SUBPATH and TESTDIR once. llvm-svn: 37108 --- test/TestRunner.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/TestRunner.sh b/test/TestRunner.sh index 1fb50cf1c2f..63e4ea7d6be 100755 --- a/test/TestRunner.sh +++ b/test/TestRunner.sh @@ -11,18 +11,20 @@ # This script is typically used by cd'ing to a test directory and then # running TestRunner.sh with a list of test file names you want to run. # +TESTPATH=`pwd` +SUBDIR="" +while test `basename $TESTPATH` != "test" -a ! -z "$TESTPATH" ; do + tmp=`basename $TESTPATH` + SUBDIR="$tmp/$SUBDIR" + TESTPATH=`dirname $TESTPATH` +done + for TESTFILE in "$@" ; do if test `dirname $TESTFILE` == . ; then - TESTPATH=`pwd` - SUBDIR="" - while test `basename $TESTPATH` != "test" -a ! -z "$TESTPATH" ; do - tmp=`basename $TESTPATH` - SUBDIR="$tmp/$SUBDIR" - TESTPATH=`dirname $TESTPATH` - done if test -d "$TESTPATH" ; then cd $TESTPATH make check-one TESTONE="$SUBDIR$TESTFILE" + cd $PWD else echo "Can't find llvm/test directory in " `pwd` fi