# $Id: check_vcdxrip_fn,v 1.2 2003/02/24 13:47:29 rocky Exp $
# Pssst.... This file is intended to be sourced...

test_vcdxrip() {

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

  # VCDXRIP="/usr/local/bin/vcdxrip"
  VCDXRIP="../frontends/xml/vcdxrip"
  
  if [ ! -x "${VCDXRIP}" ]; then
    echo "$0: ${VCDXRIP} missing, check not possible"
    return 77
  fi
  
  if ${VCDXRIP} ${opts} ; then
    if have_cmp; then
      if cmp ${xmlfile} ${rightfile} ; then
	rm -f $xmlfile
	return 0
      else
	return 3
      fi
    else
      echo "$0: No cmp(1) found - cannot test vcddump"
      return 77
    fi
  else
    echo "$0: ${VCDXRIP} ${opts} failed"
    rm -f core* $xmlfile
    return 1
  fi

  return 0

}

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