3
# runtest -- basically all this script does is find the proper expect
4
# shell and then run DejaGnu.
6
# Written by Rob Savoye <rob@welcomehome.org>
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
4
# 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
6
# This file is part of DejaGnu.
8
# DejaGnu is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 2 of the License, or
11
# (at your option) any later version.
13
# DejaGnu is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
# General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with DejaGnu; if not, write to the Free Software Foundation,
20
# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
22
# This script was written by Rob Savoye. The script finds the proper
23
# expect shell and then starts DejaGnu.
10
25
# Get the execution path to this script and the current directory.
13
28
if expr ${mypath} : '.*/.*' > /dev/null
29
44
execpath=`echo ${mypath} | sed -e 's@/[^/]*$@@'`
33
# get the name by which runtest was invoked and extract the config triplet
46
# Get the name by which runtest was invoked and extract the config
35
49
runtest=`echo ${mypath} | sed -e 's@^.*/@@'`
36
50
target=`echo $runtest | sed -e 's/-runtest$//'`
37
51
if [ "$target" != runtest ] ; then
44
# Find the right expect binary to use. If a variable EXPECT exists,
45
# it takes precedence over all other tests. Otherwise look for a freshly
57
# Find the right expect binary to use. If a variable EXPECT exists, it
58
# takes precedence over all other tests. Otherwise look for a freshly
46
59
# built one, and then use one in the path.
48
61
if [ x"$EXPECT" != x ] ; then
59
73
if [ -z "$expectbin" ]; then
60
74
echo "ERROR: No expect shell found"
64
# This wrapper script will set up run-time library search PATHs
78
# This wrapper script will set up run-time library search PATHs.
65
80
if [ -x "$expectbin-bld.sh" ]; then
66
81
expectbin="${CONFIG_SHELL-/bin/sh} $expectbin-bld.sh"
70
84
# Extract a few options from the option list.
83
97
echo Expect binary is $expectbin
87
# find runtest.exp. First we look in it's installed location, otherwise
88
# start if from the source tree.
90
# runtest.exp is found in (autoconf-configure-set) @datadir@, but
91
# $execpath is @bindir@. We're assuming that
93
# @datadir@ == @bindir@/../share
95
# @datadir@ == @bindir@/../../share
97
# which is a very weak assumption
100
# Find runtest.exp. First we look in its installed location,
101
# otherwise start if from the source tree.
103
# runtest.exp is found in @datadir@ (set by configure), but $execpath
104
# is @bindir@. We're assuming that:
106
# @datadir@ == @bindir@/../share
108
# @datadir@ == @bindir@/../../share
110
# .. which is a very weak assumption
99
112
for i in `echo ${execpath} | sed -e 's@/[^/]*$@/share/dejagnu@'` `echo ${execpath} | sed -e 's@/[^/]*/[^/]*$@/share/dejagnu@'` $execpath ; do
100
113
if expr $verbose \> 1 > /dev/null ; then
101
114
echo Looking for $i/runtest.exp.
118
133
if [ x"$runpath" = x ] ; then
119
echo "ERROR: runtest.exp does not exist."
134
echo "ERROR: runtest.exp does not exist"
138
if ! type $expectbin >/dev/null 2>/dev/null ; then
139
echo "ERROR: unable to find expect on the PATH"