Use diff rather than cmp if possible. Also if possible do a unified diff
and for M$DOG strip whitespace for the \r\n vs \n differences.
This commit is contained in:
@@ -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 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
dnl 02111-1307, USA.
|
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)
|
AC_INIT(lib/cdio.c)
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
AM_INIT_AUTOMAKE(libcdio, 0.61)
|
AM_INIT_AUTOMAKE(libcdio, 0.61)
|
||||||
@@ -57,6 +57,9 @@ fi
|
|||||||
dnl We use a perl for documentation and regression tests
|
dnl We use a perl for documentation and regression tests
|
||||||
AC_PATH_PROG(PERL, perl, no)
|
AC_PATH_PROG(PERL, perl, no)
|
||||||
AC_SUBST(PERL)dnl
|
AC_SUBST(PERL)dnl
|
||||||
|
AC_PATH_PROGS(DIFF, diff, cmp)
|
||||||
|
AC_SUBST(DIFF)dnl
|
||||||
|
|
||||||
|
|
||||||
AM_PATH_LIBPOPT(, [enable_cdinfo=no])
|
AM_PATH_LIBPOPT(, [enable_cdinfo=no])
|
||||||
|
|
||||||
@@ -268,6 +271,7 @@ AC_OUTPUT([ \
|
|||||||
src/Makefile \
|
src/Makefile \
|
||||||
test/check_nrg.sh \
|
test/check_nrg.sh \
|
||||||
test/check_cue.sh \
|
test/check_cue.sh \
|
||||||
|
test/check_common_fn \
|
||||||
test/Makefile \
|
test/Makefile \
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
SKIP_TEST_EXITCODE=77
|
||||||
|
DIFF_OPTS=
|
||||||
have_cmp() {
|
have_diff() {
|
||||||
if cmp /dev/null /dev/null > /dev/null 2>&1; then
|
if @DIFF@ ./Makefile ./Makefile > /dev/null 2>&1; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
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;
|
return 1;
|
||||||
fi
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,15 +52,15 @@ test_cdinfo() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ${CDINFO} --no-header ${opts} >${outfile} 2>&1 ; then
|
if ${CDINFO} --no-header ${opts} >${outfile} 2>&1 ; then
|
||||||
if have_cmp; then
|
if have_diff; then
|
||||||
if cmp ${outfile} ${rightfile} ; then
|
if @DIFF@ ${outfile} ${rightfile} ; then
|
||||||
rm -f $outfile
|
rm -f $outfile
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 3
|
return 3
|
||||||
fi
|
fi
|
||||||
else
|
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
|
rm -f $outfile
|
||||||
return 77
|
return 77
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user