Add iso-read regression test.

This commit is contained in:
rocky
2004-02-29 15:42:30 +00:00
parent e682e48ec6
commit 2f8b11e756
3 changed files with 80 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.am,v 1.19 2004/02/25 10:11:06 rocky Exp $
# $Id: Makefile.am,v 1.20 2004/02/29 15:42:30 rocky Exp $
#
# Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
#
@@ -85,7 +85,11 @@ check_nrg.sh: $(top_builddir)/config.status check_nrg.sh.in
chmod +x config_nrg.sh
check_cue.sh: $(top_builddir)/config.status check_cue.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
chmod +x config_cue.csh
chmod +x config_cue.sh
check_iso.sh: $(top_builddir)/config.status check_iso.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
chmod +x config_iso.sh
make-executable:

View File

@@ -1,4 +1,4 @@
# $Id: check_common_fn.in,v 1.4 2003/09/19 04:09:47 rocky Exp $
# $Id: check_common_fn.in,v 1.5 2004/02/29 15:42:30 rocky Exp $
#
# Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
#
@@ -74,6 +74,72 @@ test_cdinfo() {
}
test_iso_info() {
opts="$1"
outfile="$2"
rightfile="$3"
ISO_INFO="../src/iso-info"
if [ ! -x ${ISO_INFO} ]; then
echo "$0: No ${ISO_INFO}"
return 1
fi
if ${ISO_INFO} --no-header ${opts} >${outfile} 2>&1 ; then
if test "/usr/bin/diff" != no; then
if /usr/bin/diff -w --unified ${outfile} ${rightfile} ; then
rm -f $outfile
return 0
else
return 3
fi
else
echo "$0: No diff(1) or cmp(1 found - cannot test ${ISO_INFO}"
rm -f $outfile
return 77
fi
else
echo "$0: ${ISO_INFO} ${opts} failed"
return 2
fi
}
test_iso_read() {
opts="$1"
outfile="$2"
rightfile="$3"
ISO_READ="../src/iso-read"
if [ ! -x ${ISO_READ} ]; then
echo "$0: No ${ISO_READ}"
return 1
fi
if ${ISO_READ} ${opts} -o ${outfile} 2>&1 ; then
if test "@DIFF@" != no; then
if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then
rm -f $outfile
return 0
else
return 3
fi
else
echo "$0: No diff(1) or cmp(1 found - cannot test ${ISO_READ}"
rm -f $outfile
return 77
fi
else
echo "$0: ${ISO_READ} ${opts} failed"
return 2
fi
}
test_cd_read() {
opts="$1"

View File

@@ -1,5 +1,5 @@
#!/bin/sh
#$Id: check_iso.sh.in,v 1.1 2004/02/29 04:41:57 rocky Exp $
#$Id: check_iso.sh.in,v 1.2 2004/02/29 15:42:30 rocky Exp $
if test -z $srcdir ; then
srcdir=`pwd`
@@ -14,11 +14,16 @@ fi
BASE=`basename $0 .sh`
fname=copying
test_isoinfo "--quiet ${srcdir}/${fname}.iso --iso9660 " \
test_iso_info "--quiet ${srcdir}/${fname}.iso --iso9660 " \
${fname}.dump ${srcdir}/${fname}.right
RC=$?
check_result $RC 'iso-info test 1'
test_iso_read "--image ${srcdir}/${fname}.iso --extract $fname " \
${fname} ${srcdir}/../COPYING
RC=$?
check_result $RC 'iso-read test 1'
exit $RC
#;;; Local Variables: ***