You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
3.7 KiB

26 years ago
#!/bin/sh
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
# 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
26 years ago
#
# This file is part of DejaGnu.
26 years ago
#
# DejaGnu is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
26 years ago
#
# DejaGnu is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
26 years ago
#
# You should have received a copy of the GNU General Public License
# along with DejaGnu; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# This script was written by Rob Savoye. The script finds the proper
# expect shell and then starts DejaGnu.
# Get the execution path to this script and the current directory.
26 years ago
mypath=${0-.}
if expr ${mypath} : '.*/.*' > /dev/null
then
:
else
IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
for dir in $PATH
do
test -z "$dir" && dir=.
if test -x $dir/$mypath
then
mypath=$dir/$mypath
break
fi
done
IFS="$save_ifs"
fi
execpath=`echo ${mypath} | sed -e 's@/[^/]*$@@'`
# Get the name by which runtest was invoked and extract the config
# triplet.
26 years ago
runtest=`echo ${mypath} | sed -e 's@^.*/@@'`
target=`echo $runtest | sed -e 's/-runtest$//'`
if [ "$target" != runtest ] ; then
target="--target ${target}"
else
target=""
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
26 years ago
# built one, and then use one in the path.
26 years ago
if [ x"$EXPECT" != x ] ; then
expectbin=$EXPECT
else
if [ -x "$execpath/expect" ] ; then
expectbin=$execpath/expect
else
expectbin=expect
fi
fi
# Just to be safe ..
26 years ago
if [ -z "$expectbin" ]; then
echo "ERROR: No expect shell found"
exit 1
fi
# This wrapper script will set up run-time library search PATHs.
26 years ago
if [ -x "$expectbin-bld.sh" ]; then
expectbin="${CONFIG_SHELL-/bin/sh} $expectbin-bld.sh"
fi
26 years ago
# Extract a few options from the option list.
26 years ago
verbose=0
debug=""
for a in "$@" ; do
case $a in
26 years ago
-v|--v|-verb*|--verb*) verbose=`expr $verbose + 1`;;
-D0|--D0) debug="-D 0" ;;
-D1|--D1) debug="-D 1" ;;
esac
done
if expr $verbose \> 0 > /dev/null ; then
echo Expect binary is $expectbin
fi
# Find runtest.exp. First we look in its installed location,
# otherwise start if from the source tree.
26 years ago
#
# runtest.exp is found in @datadir@ (set by configure), but $execpath
# is @bindir@. We're assuming that:
26 years ago
#
# @datadir@ == @bindir@/../share
# or
# @datadir@ == @bindir@/../../share
26 years ago
#
# .. which is a very weak assumption
26 years ago
for i in `echo ${execpath} | sed -e 's@/[^/]*$@/share/dejagnu@'` `echo ${execpath} | sed -e 's@/[^/]*/[^/]*$@/share/dejagnu@'` $execpath ; do
if expr $verbose \> 1 > /dev/null ; then
echo Looking for $i/runtest.exp.
fi
26 years ago
if [ -f $i/runtest.exp ] ; then
runpath=$i
if expr $verbose \> 0 > /dev/null ; then
echo Using $i/runtest.exp as main test driver
fi
2003-07-25 Jim Dein <jdein@deinji5.apple.com> * lib/utils.exp: fix double recursion bug in proc find. 2002-02-25 Jackie Smith Cashion <jsmith@redhat.com> * baseboards/am33_2.0-libremote.exp: New file. 2000-11-21 Drew Moseley <dmoseley@redhat.com> * baseboards/mn10300-cygmon.exp: Use the am33-2 flag for the ASB2303 board. 2000-08-10 Drew Moseley <dmoseley@cygnus.com> * baseboards/mn10300-cygmon.exp: Added support for Cygmon based ASB2303 board. 2003-06-13 Phil Edwards <pme@devphil.com> * baseboards/mips64-sim.exp, baseboards/mips-sim.exp, baseboards/mips-sim-idt32.exp, baseboards/mips-sim-idt64.exp: Use only -T[linker] instead of -Wl,-T[linker]. 2003-06-13 Jason Thorpe <thorpej@wasabisystems.com> * lib/target.exp (prune_warnings): Add two more linker warning patterns for warnings generated by modern verions of NetBSD. 2003-05-12 H.J. Lu <hongjiu.lu@intel.com> * lib/libgloss.exp (build_wrapper): Add -Wl,-wrap,_exit. 2003-05-09 H.J. Lu <hongjiu.lu@intel.com> * runtest: Fix a typo. 2003-05-03 Nitin Dhavale <nitinpdhavale@indiatimes.com> * doc/user.sgml: Clarify how to set the verbose option. 2003-03-28 Chris Demetriou <cgd@broadcom.com> * lib/framework.exp (check_conditional_xfail): Adjust so that an empty 'includes' list matches all sets of flags. * doc/dejagnu.texi: Document the above. * doc/ref.sgml: Likewise. 2003-03-27 David Heine <dlheine@tensilica.com> * baseboards/xtensa-sim.exp: Fix a syntax error. 2003-03-16 Rob Savoye <rob@direwolf.welcomehome.org> * lib/unix.exp: Preserve the value of LD_LIBRARY_PATH, rather than stomp on it. This is based on a patch from Brendan Conoboy <blc@redhat.com>. * Most files: Update copyright dates.
23 years ago
break;
26 years ago
fi
done
# Check for an environment variable.
26 years ago
if [ x"$DEJAGNULIBS" != x ] ; then
runpath=$DEJAGNULIBS
if expr $verbose \> 0 > /dev/null ; then
echo Using $DEJAGNULIBS/runtest.exp as main test driver
fi
fi
if [ x"$runpath" = x ] ; then
echo "ERROR: runtest.exp does not exist"
exit 1
fi
if ! type $expectbin >/dev/null 2>/dev/null ; then
echo "ERROR: unable to find expect on the PATH"
26 years ago
exit 1
fi
exec $expectbin $debug -- $runpath/runtest.exp $target ${1+"$@"}