Chris Lattner | 9a3c2b5 | 2002-02-01 04:24:47 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
Reid Spencer | 0e72512 | 2007-04-26 03:59:24 +0000 | [diff] [blame^] | 3 | # TestRunner.sh - This script is used to run the deja-gnu tests exactly like |
| 4 | # deja-gnu does, by executing the Tcl script specified in the test case's |
| 5 | # RUN: lines. This is made possible by a simple make target supported by the |
| 6 | # test/Makefile. All this script does is invoke that make target. |
Chris Lattner | 9a3c2b5 | 2002-02-01 04:24:47 +0000 | [diff] [blame] | 7 | # |
Reid Spencer | 0e72512 | 2007-04-26 03:59:24 +0000 | [diff] [blame^] | 8 | # Usage: |
| 9 | # TestRunner.sh {script_names} |
Chris Lattner | dec2d79 | 2003-05-14 18:39:57 +0000 | [diff] [blame] | 10 | # |
Reid Spencer | 0e72512 | 2007-04-26 03:59:24 +0000 | [diff] [blame^] | 11 | # This script is typically used by cd'ing to a test directory and then |
| 12 | # running TestRunner.sh with a list of test file names you want to run. |
Chris Lattner | 9a3c2b5 | 2002-02-01 04:24:47 +0000 | [diff] [blame] | 13 | # |
Reid Spencer | 0e72512 | 2007-04-26 03:59:24 +0000 | [diff] [blame^] | 14 | for TESTFILE in "$@" ; do |
| 15 | if test `dirname $TESTFILE` == . ; then |
| 16 | TESTPATH=`pwd` |
| 17 | SUBDIR="" |
| 18 | while test `basename $TESTPATH` != "test" -a ! -z "$TESTPATH" ; do |
| 19 | tmp=`basename $TESTPATH` |
| 20 | SUBDIR="$tmp/$SUBDIR" |
| 21 | TESTPATH=`dirname $TESTPATH` |
| 22 | done |
| 23 | if test -d "$TESTPATH" ; then |
| 24 | cd $TESTPATH |
| 25 | make check-one TESTONE="$SUBDIR$TESTFILE" |
| 26 | else |
| 27 | echo "Can't find llvm/test directory in " `pwd` |
| 28 | fi |
Reid Spencer | 4142579 | 2007-04-15 06:47:49 +0000 | [diff] [blame] | 29 | else |
Reid Spencer | 0e72512 | 2007-04-26 03:59:24 +0000 | [diff] [blame^] | 30 | make check-one TESTONE=$TESTFILE |
Reid Spencer | 4142579 | 2007-04-15 06:47:49 +0000 | [diff] [blame] | 31 | fi |
Reid Spencer | 0e72512 | 2007-04-26 03:59:24 +0000 | [diff] [blame^] | 32 | done |