Fix PR1355: Only compute the SUBPATH and TESTDIR once.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37108 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2007-05-16 17:56:56 +00:00
parent fab21b0291
commit 562744c4ed

View File

@ -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