#!/bin/sh

SCRIPTDIR=`dirname $0`

PORTNAME=`echo "(string (port-name))" | italk -no-init-file -silent 2>/dev/null | tail -1 | sed -e "s/^.//" -e "s/.$//" `

RATIOX=$HOME/talk-play/$PORTNAME/ratiox
RATIOTEST=$HOME/talk-play/$PORTNAME/ratiotest

if [ ! -x $RATIOX ]
then echo "** please build-ratiox first."
     exit 1
fi

# be cautious
set -e

echo
echo "Building test application ratiotest..."
$RATIOX $ILT_DIR/talk/contrib/cmain/src/ratiotest.cc
echo ...done
echo
echo "Running test application ratiotest (the first time, it builds its image)..."
$RATIOTEST
echo ...done
echo
echo "Running test application ratiotest (it now uses its image)..."
$RATIOTEST
echo ...done
echo
echo "Running test application ratiotest (one more time)..."
$RATIOTEST
