#!/bin/sh
# test pipe for Grace   Voi aussi dotest
#  Voir ./Makefile
#

export GRACEGTK_HOME

# define the location
#
if test -x ../src/ggrace
then
	GRACE=../src/ggrace
	GRACEGTK_HOME=`pwd`/..

else
if test -x ../bin/gggrace
then
        GRACE=../bin/ggrace
	GRACEGTK_HOME=`pwd`/..
else
	GRACE=ggrace
fi
fi

# don't ask stupid questions :)
#
GRACE="$GRACE -noask"
#

echo 'GRACE='$GRACE
echo 'GRACEGTK_HOME='$GRACEGTK_HOME

# need a program
# modified from previous versions, a thank you goes to Bruce Barnett
# this modification allows others without write permission
# to run the demos.
#
echo ""
if test ! -f tmc
then
      echo ""
      echo "Compiling a short program to test the -pipe option"
      echo "Executing 'cc tmc.c -o tmc -lm'"
      cc tmc.c -o tmc -lm
      echo "Done compilation"
      echo ""
fi

#
# a graph with the -pipe option
echo "Testing -pipe option, executing './tmc | $GRACE -pipe' "
./tmc | $GRACE -pipe 

#  rm -f tmc.o tmc

