URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [insight/] [dejagnu/] [runtest] - Rev 1768
Go to most recent revision | Compare with Previous | Blame | View Log
#!/bin/sh## runtest -- basically all this script does is find the proper expect# shell and then run DejaGnu.## Written by Rob Savoye <rob@cygnus.com>### Get the execution path to this script and the current directory.#mypath=${0-.}if expr ${mypath} : '.*/.*' > /dev/nullthen:elseIFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"for dir in $PATHdotest -z "$dir" && dir=.if test -x $dir/$mypaththenmypath=$dir/$mypathbreakfidoneIFS="$save_ifs"fiexecpath=`echo ${mypath} | sed -e 's@/[^/]*$@@'`# rootme=`pwd`## get the name by which runtest was invoked and extract the config triplet#runtest=`echo ${mypath} | sed -e 's@^.*/@@'`target=`echo $runtest | sed -e 's/-runtest$//'`if [ "$target" != runtest ] ; thentarget="--target ${target}"elsetarget=""fi## Find the right expect binary to use. If a variable EXPECT exists,# it takes precedence over all other tests. Otherwise look for a freshly# built one, and then use one in the path.#if [ x"$EXPECT" != x ] ; thenexpectbin=$EXPECTelseif [ -x "$execpath/expect" ] ; thenexpectbin=$execpath/expectelseexpectbin=expectfifi# just to be safe...if [ -z "$expectbin" ]; thenecho "ERROR: No expect shell found"exit 1fi# This wrapper script will set up run-time library search PATHsif [ -x "$expectbin-bld.sh" ]; thenexpectbin="${CONFIG_SHELL-/bin/sh} $expectbin-bld.sh"fi## Extract a few options from the option list.#verbose=0debug=""for a in "$@" ; docase $a in-v|--v|-verb*|--verb*) verbose=`expr $verbose + 1`;;-D0|--D0) debug="-D 0" ;;-D1|--D1) debug="-D 1" ;;esacdoneif expr $verbose \> 0 > /dev/null ; thenecho Expect binary is $expectbinfi## find runtest.exp. First we look in it's installed location, otherwise# start if from the source tree.## runtest.exp is found in (autoconf-configure-set) @datadir@, but# $execpath is @bindir@. We're assuming that## @datadir@ == @bindir@/../share# or# @datadir@ == @bindir@/../../share## which is a very weak assumption#for i in `echo ${execpath} | sed -e 's@/[^/]*$@/share/dejagnu@'` `echo ${execpath} | sed -e 's@/[^/]*/[^/]*$@/share/dejagnu@'` $execpath ; doif expr $verbose \> 1 > /dev/null ; thenecho Looking for $i/runtest.exp.fiif [ -f $i/runtest.exp ] ; thenrunpath=$iif expr $verbose \> 0 > /dev/null ; thenecho Using $i/runtest.exp as main test driverfifidone# check for an environment variableif [ x"$DEJAGNULIBS" != x ] ; thenrunpath=$DEJAGNULIBSif expr $verbose \> 0 > /dev/null ; thenecho Using $DEJAGNULIBS/runtest.exp as main test driverfifiif [ x"$runpath" = x ] ; thenecho "ERROR: runtest.exp does not exist."exit 1fiexec $expectbin $debug -- $runpath/runtest.exp $target ${1+"$@"}
Go to most recent revision | Compare with Previous | Blame | View Log
