#!/bin/sh

DIFF=diff

if [ "x$GCTLIB" = "x" ]
then
  GCTLIB=`pwd`/../../../
  PATH=.:`pwd`/../../..:$PATH
  export PATH
fi

build()
{
  gct-init $GCTLIB
  gct -B$GCTLIB -o executable master.c secondU.c secondI.c
  executable > exec.log
  $DIFF exec.log exec.ref
}


say()
{
	echo "$INDENT" " $1"
}



say included-off
make clean
cp gct-ctrl.base gct-ctrl
build
greport -all GCTLOG > off-report.log; $DIFF off-report.log off-report.ref
gsummary GCTLOG > off-sum.log; $DIFF off-sum.log off-sum.ref
gsummary -f GCTLOG > off-sumf.log; $DIFF off-sumf.log off-sumf.ref
gsummary -r GCTLOG > off-sumr.log; $DIFF off-sumr.log off-sumr.ref

say included-on
make clean
cp gct-ctrl.base gct-ctrl
echo "(options instrument-included-files)" >> gct-ctrl
build
greport -all GCTLOG > on-report.log; $DIFF on-report.log on-report.ref
gsummary GCTLOG > on-sum.log; $DIFF on-sum.log on-sum.ref
gsummary -files GCTLOG > on-sumf.log; $DIFF on-sumf.log on-sumf.ref
gsummary -routines GCTLOG > on-sumr.log; $DIFF on-sumr.log on-sumr.ref


exit 0
