From 1f60f6f2d3819748c563802a81bb10eb045a379f Mon Sep 17 00:00:00 2001 From: "R. Bernstein" Date: Sun, 4 Mar 2012 00:09:02 -0500 Subject: 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/* --- test/Makefile.am | 9 +++++--- test/check_cd_read.sh | 2 -- test/check_common_fn.in | 2 +- test/check_udf.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ test/data/test-udf1.iso | Bin 0 -> 911360 bytes 5 files changed, 61 insertions(+), 6 deletions(-) create mode 100755 test/check_udf.sh create mode 100644 test/data/test-udf1.iso (limited to 'test') 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 +# Copyright (C) 2003, 2004, 2006, 2008, 2009, 2010 +# 2012 Rocky Bernstein # # 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 # # 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 +# +# 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 . +# +# 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 Binary files /dev/null and b/test/data/test-udf1.iso differ -- cgit v1.2.3