tests -> test
All public includes are included via #include <cdio/....h> rather than #include "....h" (removed -I $top_srcdir/include/cdio)
This commit is contained in:
71
test/check_common_fn
Executable file
71
test/check_common_fn
Executable file
@@ -0,0 +1,71 @@
|
||||
# $Id: check_common_fn,v 1.1 2003/04/22 12:09:09 rocky Exp $
|
||||
SKIP_TEST_EXITCODE=77
|
||||
|
||||
have_cmp() {
|
||||
if cmp /dev/null /dev/null > /dev/null 2>&1; then
|
||||
:
|
||||
else
|
||||
|
||||
return 1;
|
||||
fi
|
||||
|
||||
if cmp /dev/zero /dev/null > /dev/null 2>&1; then
|
||||
return 1;
|
||||
fi
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
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
|
||||
else
|
||||
echo "$0: $msg ok."
|
||||
fi
|
||||
}
|
||||
|
||||
test_cdinfo() {
|
||||
|
||||
opts="$1"
|
||||
outfile="$2"
|
||||
rightfile="$3"
|
||||
|
||||
CDINFO="../src/cdinfo"
|
||||
|
||||
if [ ! -x ${CDINFO} ]; then
|
||||
echo "$0: No cdinfo"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ${CDINFO} ${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 cdinfo"
|
||||
rm -f $outfile
|
||||
return 77
|
||||
fi
|
||||
else
|
||||
echo "$0: ${CDINFO} ${opts} failed"
|
||||
return 2
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
#;;; Local Variables: ***
|
||||
#;;; mode:shell-script ***
|
||||
#;;; eval: (sh-set-shell "bash") ***
|
||||
#;;; End: ***
|
||||
Reference in New Issue
Block a user