SSE4 is apparently public now.
[oota-llvm.git] / test / TestRunner.sh
index d0e4ad71b8fce1c8419aab309fa42dbef4e7f5d2..04a86bceb18e0ebab7ba8daecb934b07fb3fdc7f 100755 (executable)
@@ -8,35 +8,25 @@
 #
 #     %s - Replaced with the input name of the program, or the program to
 #          execute, as appropriate.
+#     %llvmgcc - llvm-gcc command
+#     %llvmgxx - llvm-g++ command
+#     %prcontext - prcontext.tcl script
 #
-
-FILENAME=$1
-TESTNAME=$1
-SUBST=$1
-OUTPUT=Output/$FILENAME.out
-
-if test $# != 1; then
-  # If more than one parameter is passed in, there must be three parameters:
-  # The filename to read from (already processed), the command used to execute,
-  # and the file to output to.
-  SUBST=$2
-  OUTPUT=$3
-  TESTNAME=$3
+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
-
-ulimit -t 40
-
-SCRIPT=$OUTPUT.script
-grep 'RUN:' $FILENAME | sed "s|^.*RUN:\(.*\)$|\1|g;s|%s|$SUBST|g;s|%llvmgcc|llvmgcc|g" > $SCRIPT
-
-
-/bin/sh $SCRIPT > $OUTPUT 2>&1 || (
-  echo "******************** TEST '$TESTNAME' FAILED! ********************"
-  echo "Command: "
-  cat $SCRIPT
-  echo "Output:"
-  cat $OUTPUT
-  rm $OUTPUT
-  echo "******************** TEST '$TESTNAME' FAILED! ********************"
-)
-