[cfe-commits] r39608 - in /cfe/cfe/trunk/test: Makefile TestRunner.sh

clattner at cs.uiuc.edu clattner at cs.uiuc.edu
Wed Jul 11 09:46:12 PDT 2007


Author: clattner
Date: Wed Jul 11 11:46:12 2007
New Revision: 39608

URL: http://llvm.org/viewvc/llvm-project?rev=39608&view=rev
Log:
Make make check work again.

Added:
    cfe/cfe/trunk/test/TestRunner.sh   (with props)
Modified:
    cfe/cfe/trunk/test/Makefile

Modified: cfe/cfe/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/test/Makefile?rev=39608&r1=39607&r2=39608&view=diff

==============================================================================
--- cfe/cfe/trunk/test/Makefile (original)
+++ cfe/cfe/trunk/test/Makefile Wed Jul 11 11:46:12 2007
@@ -1,3 +1,3 @@
 
 all:
-	find Lexer Preprocessor Parser -name '*.c*' -print -exec ~/llvm/test/TestRunner.sh {} \;
+	find Lexer Preprocessor Parser -name '*.c*' -print -exec ./TestRunner.sh {} \;

Added: cfe/cfe/trunk/test/TestRunner.sh
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/test/TestRunner.sh?rev=39608&view=auto

==============================================================================
--- cfe/cfe/trunk/test/TestRunner.sh (added)
+++ cfe/cfe/trunk/test/TestRunner.sh Wed Jul 11 11:46:12 2007
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+#  TestRunner.sh - This script is used to run arbitrary unit tests.  Unit
+#  tests must contain the command used to run them in the input file, starting
+#  immediately after a "RUN:" string.
+#
+#  This runner recognizes and replaces the following strings in the command:
+#
+#     %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
+FILENAME_ONLY=`basename $1`
+OUTPUT=Output/$FILENAME_ONLY.out
+
+# create the output directory if it does not already exist
+mkdir Output > /dev/null 2>&1
+
+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
+fi
+
+ulimit -t 40
+
+SCRIPT=$OUTPUT.script
+grep 'RUN:' $FILENAME | sed "s|^.*RUN:\(.*\)$|\1|g;s|%s|$SUBST|g;s|%llvmgcc|llvm-gcc -emit-llvm|g;s|%llvmgxx|llvm-g++ -emit-llvm|g;s|%prcontext|prcontext.tcl|g" > $SCRIPT
+
+grep -q XFAIL $FILENAME && (printf "XFAILED '$TESTNAME': "; grep XFAIL $FILENAME)
+
+/bin/sh $SCRIPT > $OUTPUT 2>&1 || (
+  echo "******************** TEST '$TESTNAME' FAILED! ********************"
+  echo "Command: "
+  cat $SCRIPT
+  echo "Output:"
+  cat $OUTPUT
+  rm $OUTPUT
+  echo "******************** TEST '$TESTNAME' FAILED! ********************"
+)
+

Propchange: cfe/cfe/trunk/test/TestRunner.sh

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/cfe/trunk/test/TestRunner.sh

------------------------------------------------------------------------------
    svn:executable = *

Propchange: cfe/cfe/trunk/test/TestRunner.sh

------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision





More information about the cfe-commits mailing list