# $Id: check_common_fn.in,v 1.2 2003/06/08 13:08:37 rocky Exp $
SKIP_TEST_EXITCODE=77
check_result() {
RC=$1
shift
msg=$*
if test $RC -ne 0 ; then
if test $RC -ne $SKIP_TEST_EXITCODE ; then
echo "$0: $msg failed."
exit $RC
else
echo "$0: $msg skipped."
fi
echo "$0: $msg ok."
}
test_cdinfo() {
opts="$1"
outfile="$2"
rightfile="$3"
CDINFO="../src/cd-info"
if [ ! -x ${CDINFO} ]; then
echo "$0: No ${CDINFO}"
return 1
if ${CDINFO} --no-header ${opts} >${outfile} 2>&1 ; then
if test "@DIFF@" != no; then
if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then
rm -f $outfile
return 0
return 3
echo "$0: No diff(1) or cmp(1 found - cannot test ${CDINFO}"
return 77
echo "$0: ${CDINFO} ${opts} failed"
return 2
#;;; Local Variables: ***
#;;; mode:shell-script ***
#;;; eval: (sh-set-shell "bash") ***
#;;; End: ***