#!/bin/sh -f
#################################################################
#
#  Script to make new Makefile entry for a test
#
#################################################################

RDP_OPTS=""

#
#  either att, cov, ew, tex, ms
#
TYPE="att" 

#
#  Three digit test number
#
TNUM="000"

print_entry()
{
  NUM=`expr ${TNUM} + 0`
  echo "#"
  echo "#  test${TNUM}_${TYPE}"
  echo "#"
  echo "#"
  echo "#"
  echo "OutData/test${TNUM}_${TYPE}_cvf_0.rgb: \$($1)/test${TNUM}.${NUM}.rdp.Z \$($1)/test${TNUM}.${NUM}.mem.Z"
  echo "\t$(TESTIT) -n ${TNUM} -t ${TYPE} -s cv"
  echo "OutData/test${TNUM}_${TYPE}_cf_0.rgb: \$($1)/test${TNUM}.${NUM}.rdp.Z \$($1)/test${TNUM}.${NUM}.mem.Z"
  echo "\t$(TESTIT) -n ${TNUM} -t ${TYPE} -s c"
  echo "OutData/test${TNUM}_${TYPE}_iof_0.rgb: \$($1)/test${TNUM}.${NUM}.rdp.Z \$($1)/test${TNUM}.${NUM}.mem.Z"
  echo "\t$(TESTIT) -n ${TNUM} -t ${TYPE} -s io"
}

##################################################
#  Main
#
##################################################
  while getopts "n:t:s:" a
  do
    case $a in
    	n)  TNUM=$OPTARG;;
    	t)  TYPE=$OPTARG;;
    esac
  done
  shift `expr $OPTIND - 1`

  #  Determine app directory
  case ${TYPE} in
	"att") print_entry ATTDEPTH;;
	"tex") print_entry TEXDEPTH;;
	"cov") print_entry COVDEPTH;;
	"ew")  print_entry EWDEPTH;;
	"ms")  print_entry MSDEPTH;;
	*)     echo "Unrecognized type: ${TYPE}"
	       exit 1;;
  esac
  
# End testit
