From 698596b45e606caeca3242914a17399ed4d051f2 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Sun, 8 Feb 2004 21:13:11 +0000 Subject: * runtest: Improve comments. --- runtest | 71 +++++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 28 deletions(-) (limited to 'runtest') diff --git a/runtest b/runtest index 417e4f9..e221100 100755 --- a/runtest +++ b/runtest @@ -1,14 +1,29 @@ #!/bin/sh # -# runtest -- basically all this script does is find the proper expect -# shell and then run DejaGnu. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +# 2001, 2002, 2003, 2004 Free Software Foundation, Inc. # -# Written by Rob Savoye +# This file is part of DejaGnu. # - +# 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. # -# Get the execution path to this script and the current directory. +# 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. # +# 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. + mypath=${0-.} if expr ${mypath} : '.*/.*' > /dev/null then @@ -27,11 +42,10 @@ else IFS="$save_ifs" fi execpath=`echo ${mypath} | sed -e 's@/[^/]*$@@'` -# rootme=`pwd` -# -# get the name by which runtest was invoked and extract the config triplet -# +# 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 ] ; then @@ -40,11 +54,10 @@ 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 +# 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 ] ; then expectbin=$EXPECT else @@ -55,20 +68,21 @@ else fi fi -# just to be safe... +# Just to be safe .. + if [ -z "$expectbin" ]; then echo "ERROR: No expect shell found" exit 1 fi -# This wrapper script will set up run-time library search PATHs +# This wrapper script will set up run-time library search PATHs. + if [ -x "$expectbin-bld.sh" ]; then expectbin="${CONFIG_SHELL-/bin/sh} $expectbin-bld.sh" fi -# # Extract a few options from the option list. -# + verbose=0 debug="" for a in "$@" ; do @@ -83,19 +97,18 @@ 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. # -# find runtest.exp. First we look in it's installed location, otherwise -# start if from the source tree. +# runtest.exp is found in @datadir@ (set by configure), but $execpath +# is @bindir@. We're assuming that: # -# 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 +# @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 ; do if expr $verbose \> 1 > /dev/null ; then echo Looking for $i/runtest.exp. @@ -108,7 +121,9 @@ for i in `echo ${execpath} | sed -e 's@/[^/]*$@/share/dejagnu@'` `echo ${execpa break; fi done -# check for an environment variable + +# Check for an environment variable. + if [ x"$DEJAGNULIBS" != x ] ; then runpath=$DEJAGNULIBS if expr $verbose \> 0 > /dev/null ; then -- cgit v1.1