#!/bin/sh
#
# Record a session with xlab.
# JAC Sept 26 1998
#

if [ $# -lt 1 ] || [ $# -gt 2 ] 
then
	echo "usage: $0 test [motif]"
	exit
fi

if test x$XLAB = x
then
    XLAB=xlab
fi

#
# set up output directory
#
dir=`dirname $1`/xlab
if (test ! -d $dir)
then
   mkdir $dir
fi

#
# start the xlab server (in autoexit, record mode)
#
$XLAB -e -r$dir/$1.xcalls 2> $dir/$1.rxlog >$dir/$1.rxlog &
sleep 1

#
# start the specified test
#

if test x$2 = xmotif
then
   version=.motif
fi
make ./$1$version
./$1$version -display localhost:1 2> $dir/$1.rlog > $dir/$1.rlog


