summaryrefslogtreecommitdiff
path: root/test/TestRunner.sh
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-05-16 17:56:56 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-05-16 17:56:56 +0000
commit562744c4ede28af407366ba16c6c67f6475712a9 (patch)
tree6a0cb6fe235980bd6eb1848152db173f430f2562 /test/TestRunner.sh
parentfab21b0291b55c28784fa4d785448a0faf68efa3 (diff)
downloadllvm-562744c4ede28af407366ba16c6c67f6475712a9.tar.gz
llvm-562744c4ede28af407366ba16c6c67f6475712a9.tar.bz2
llvm-562744c4ede28af407366ba16c6c67f6475712a9.tar.xz
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
Diffstat (limited to 'test/TestRunner.sh')
-rwxr-xr-xtest/TestRunner.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/TestRunner.sh b/test/TestRunner.sh
index 1fb50cf1c2..63e4ea7d6b 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