summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorR. Bernstein <rocky@gnu.org>2012-03-04 00:09:02 -0500
committerR. Bernstein <rocky@gnu.org>2012-03-04 00:09:02 -0500
commit1f60f6f2d3819748c563802a81bb10eb045a379f (patch)
treec46e19ba060d026e4625331867bf141f21ee6729 /test
parent3e8bf97c66ef91c782285bc1751121065bcab910 (diff)
test/*: Add first UDF test - test sequential file extraction.
example/extract.c: give non-zero return code if we can't find UDF image test/*
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am9
-rwxr-xr-xtest/check_cd_read.sh2
-rwxr-xr-xtest/check_common_fn.in2
-rwxr-xr-xtest/check_udf.sh54
-rw-r--r--test/data/test-udf1.isobin0 -> 911360 bytes
5 files changed, 61 insertions, 6 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 2c140576..0c3cd1fa 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,4 +1,5 @@
-# Copyright (C) 2003, 2004, 2006, 2008, 2009, 2010 Rocky Bernstein <rocky@gnu.org>
+# Copyright (C) 2003, 2004, 2006, 2008, 2009, 2010
+# 2012 Rocky Bernstein <rocky@gnu.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -51,9 +52,11 @@ test_lib_driver_util_CFLAGS = -DDATA_DIR=\"$(DATA_DIR)\"
testpregap_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
testpregap_CFLAGS = -DDATA_DIR=\"$(DATA_DIR)\"
-check_SCRIPTS = check_nrg.sh check_cue.sh check_cd_read.sh \
+check_SCRIPTS = check_nrg.sh check_cue.sh check_cd_read.sh check_udf.sh \
check_iso.sh check_fuzzyiso.sh check_opts.sh
+check_udf.sh: @abs_top_builddir@/example/extract$(EXEEXT)
+
check_PROGRAMS = $(hack)
check_DATA = vcd_demo.right vcd_demo_vcdinfo.right \
@@ -67,7 +70,7 @@ check_DATA = vcd_demo.right vcd_demo_vcdinfo.right \
isofs-m1-read.right cdda-read.right cdtext.right \
copying.right copying-rr.right \
joliet.right joliet-nojoliet.right \
- udf102.iso copying.gpl copying-rr.gpl
+ copying.gpl copying-rr.gpl
EXTRA_DIST = $(check_SCRIPTS) $(check_DATA) \
check_common_fn check_cue.sh.in check_nrg.sh.in \
diff --git a/test/check_cd_read.sh b/test/check_cd_read.sh
index 1d5667f9..96533fe0 100755
--- a/test/check_cd_read.sh
+++ b/test/check_cd_read.sh
@@ -1,6 +1,4 @@
#!/bin/sh
-# $Id: check_cd_read.sh,v 1.12 2008/03/22 18:08:25 karl Exp $
-#
# Copyright (C) 2003, 2005, 2008, 2010 Rocky Bernstein <rocky@gnu.org>
#
# This program is free software: you can redistribute it and/or modify
diff --git a/test/check_common_fn.in b/test/check_common_fn.in
index 95b66ab2..d6d99f1d 100755
--- a/test/check_common_fn.in
+++ b/test/check_common_fn.in
@@ -39,7 +39,7 @@ check_result() {
cmdline="$cmd $*"
if test $RC -ne 0 ; then
if test $RC -ne $SKIP_TEST_EXITCODE ; then
- echo "$0: $msg failed in comparing output."
+ echo "$0: $msg failed."
if test -n "$cmdline" ; then
echo "$0: failed command:"
echo " $cmdline"
diff --git a/test/check_udf.sh b/test/check_udf.sh
new file mode 100755
index 00000000..ae315370
--- /dev/null
+++ b/test/check_udf.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+# Copyright (C) 2012 Rocky Bernstein <rocky@gnu.org>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Tests to see that CD reading is correct (via cd-read).
+
+if test -z $srcdir ; then
+ srcdir=`pwd`
+fi
+
+if test "X$top_builddir" = "X" ; then
+ top_builddir=`pwd`/..
+fi
+
+if test ! -x $top_builddir/example/extract ; then
+ exit 77
+fi
+
+. ${top_builddir}/test/check_common_fn
+
+extract_dir=/tmp/udf-$$
+if test -d $extract_dir ; then
+ rm -fr $extract_dir
+fi
+
+udf_iso=$srcdir/data/test-udf1.iso
+extract_program=$top_builddir/example/extract
+cmd="$extract_program $udf_iso $extract_dir"
+$cmd
+RC=$?
+check_result $RC "$cmd"
+
+if test $RC -eq 0 ; then
+ rm -fr $extract_dir
+fi
+
+exit $RC
+
+#;;; Local Variables: ***
+#;;; mode:shell-script ***
+#;;; eval: (sh-set-shell "bash") ***
+#;;; End: ***
diff --git a/test/data/test-udf1.iso b/test/data/test-udf1.iso
new file mode 100644
index 00000000..181b9df2
--- /dev/null
+++ b/test/data/test-udf1.iso
Binary files differ