diff --git a/configure.ac b/configure.ac index 8c9512bf..6bbdc389 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. -AC_REVISION([$Id: configure.ac,v 1.25 2003/06/07 08:53:16 rocky Exp $])dnl +AC_REVISION([$Id: configure.ac,v 1.26 2003/06/08 12:33:37 rocky Exp $])dnl AC_INIT(lib/cdio.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(libcdio, 0.61) @@ -57,6 +57,9 @@ fi dnl We use a perl for documentation and regression tests AC_PATH_PROG(PERL, perl, no) AC_SUBST(PERL)dnl +AC_PATH_PROGS(DIFF, diff, cmp) +AC_SUBST(DIFF)dnl + AM_PATH_LIBPOPT(, [enable_cdinfo=no]) @@ -268,6 +271,7 @@ AC_OUTPUT([ \ src/Makefile \ test/check_nrg.sh \ test/check_cue.sh \ + test/check_common_fn \ test/Makefile \ ]) diff --git a/test/check_common_fn b/test/check_common_fn.in similarity index 60% rename from test/check_common_fn rename to test/check_common_fn.in index 0d2f25ba..e121dd5d 100755 --- a/test/check_common_fn +++ b/test/check_common_fn.in @@ -1,18 +1,24 @@ -# $Id: check_common_fn,v 1.4 2003/06/07 20:41:21 rocky Exp $ +# $Id: check_common_fn.in,v 1.1 2003/06/08 12:33:38 rocky Exp $ SKIP_TEST_EXITCODE=77 - -have_cmp() { - if cmp /dev/null /dev/null > /dev/null 2>&1; then +DIFF_OPTS= +have_diff() { + if @DIFF@ ./Makefile ./Makefile > /dev/null 2>&1; then : else return 1; fi - if cmp /dev/zero /dev/null > /dev/null 2>&1; then + if @DIFF@ ./Makefile ./check_common_fn.in > /dev/null 2>&1; then return 1; fi - + + # MSDOG output uses \r\n rather than \n in tests + for diff_opt in -w --unified ; do + if @DIFF@ $opt ./Makefile ./Makefile > /dev/null 2>&1; then + DIFF_OPTS="$DIFF_OPTS $diff_opt" + fi + done return 0; } @@ -46,15 +52,15 @@ test_cdinfo() { fi if ${CDINFO} --no-header ${opts} >${outfile} 2>&1 ; then - if have_cmp; then - if cmp ${outfile} ${rightfile} ; then + if have_diff; then + if @DIFF@ ${outfile} ${rightfile} ; then rm -f $outfile return 0 else return 3 fi else - echo "$0: No cmp(1) found - cannot test cdinfo" + echo "$0: No diff(1) or cmp(1 found - cannot test ${CDINFO}" rm -f $outfile return 77 fi