Make it possible to run this from within subdirectories of llvm/test
authorReid Spencer <rspencer@reidspencer.com>
Sun, 15 Apr 2007 06:47:49 +0000 (06:47 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 15 Apr 2007 06:47:49 +0000 (06:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36052 91177308-0d34-0410-b5e6-96231b3b80d8

test/TestRunner.sh

index 4e3d190e4accb19e3df6fde2d2bfb15a4874faa7..04a86bceb18e0ebab7ba8daecb934b07fb3fdc7f 100755 (executable)
 #     %llvmgxx - llvm-g++ command
 #     %prcontext - prcontext.tcl script
 #
-make check-one TESTONE=$1
+TESTFILE=$1
+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"
+  else
+    echo "Can't find llvm/test directory in " `pwd`
+  fi
+else
+  make check-one TESTONE=$TESTFILE
+fi