blob: 1fb50cf1c2fa740abf72f619242e979524c96260 [file] [log] [blame]
Chris Lattner9a3c2b52002-02-01 04:24:47 +00001#!/bin/sh
2#
Reid Spencer0e725122007-04-26 03:59:24 +00003# 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 Lattner9a3c2b52002-02-01 04:24:47 +00007#
Reid Spencer0e725122007-04-26 03:59:24 +00008# Usage:
9# TestRunner.sh {script_names}
Chris Lattnerdec2d792003-05-14 18:39:57 +000010#
Reid Spencer0e725122007-04-26 03:59:24 +000011# 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 Lattner9a3c2b52002-02-01 04:24:47 +000013#
Reid Spencer0e725122007-04-26 03:59:24 +000014for 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 Spencer41425792007-04-15 06:47:49 +000029 else
Reid Spencer0e725122007-04-26 03:59:24 +000030 make check-one TESTONE=$TESTFILE
Reid Spencer41425792007-04-15 06:47:49 +000031 fi
Reid Spencer0e725122007-04-26 03:59:24 +000032done