# $Id: check_vcddump_fn,v 1.5 2003/02/23 01:00:42 rocky Exp $
# Pssst.... This file is intended to be sourced...

test_vcdrip_cleanup() {
  rm -f $outfile
}

test_vcddump() {

  opts="$1"
  outfile="$2"
  rightfile="$3"

  VCDDUMP="../frontends/cli/vcddump"

  if [ ! -x ${VCDDUMP} ]; then
    echo "$0: No vcddump test skipped"
    return 77
  fi

  if ${VCDDUMP} ${opts} >${outfile} 2>&1 ; then 
    if have_cmp; then
      if cmp ${outfile} ${rightfile} ; then
	rm -f $outfile
	return 0
      else
	return 3
      fi
    else
      echo "$0: No cmp(1) found - cannot test vcddump"
      rm -f $outfile
      return 77
    fi
  else
    echo "$0: ${VCDDUMP} ${opts} failed"
    return 2
  fi

}

#;;; Local Variables: ***
#;;; mode:shell-script ***
#;;; eval: (sh-set-shell "bash") ***
#;;; End: ***
