Makefile.am: added unit tests for the archive plugins

This commit is contained in:
Max Kellermann 2009-12-31 11:11:14 +01:00
parent efc885a9dc
commit a0384aaead
7 changed files with 64 additions and 0 deletions

1
.gitignore vendored
View File

@ -55,3 +55,4 @@ test/run_input
test/read_mixer
test/dump_playlist
test/run_normalize
test/tmp

View File

@ -755,6 +755,8 @@ sparse-check:
if ENABLE_TEST
TESTS =
noinst_PROGRAMS = \
test/read_conf \
test/run_input \
@ -974,6 +976,18 @@ test_read_mixer_SOURCES = test/read_mixer.c \
src/fd_util.c \
$(MIXER_SRC)
if ENABLE_BZIP2_TEST
TESTS += test/test_archive_bzip2.sh
endif
if ENABLE_ZZIP_TEST
TESTS += test/test_archive_zzip.sh
endif
if ENABLE_ISO9660_TEST
TESTS += test/test_archive_iso9660.sh
endif
endif

1
NEWS
View File

@ -80,6 +80,7 @@ ver 0.16 (20??/??/??)
* CUE sheet support
* obey $(sysconfdir) for default mpd.conf location
* build with large file support by default
* added test suite ("make check")
* require GLib 2.12

View File

@ -353,8 +353,14 @@ fi
AM_CONDITIONAL(HAVE_BZ2, test x$enable_bzip2 = xyes)
if test x$enable_bzip2 = xyes; then
AC_DEFINE(HAVE_BZ2, 1, [Define to have bz2 archive support])
AC_PATH_PROG(BZIP2, bzip2, no)
else
BZIP2="no"
fi
AM_CONDITIONAL(ENABLE_BZIP2_TEST, test x$BZIP2 != xno)
dnl zzip
AC_ARG_ENABLE(zzip,
AS_HELP_STRING([--enable-zzip],
@ -367,8 +373,14 @@ MPD_AUTO_PKG(zzip, ZZIP, [zziplib >= 0.13],
AM_CONDITIONAL(HAVE_ZZIP, test x$enable_zzip = xyes)
if test x$enable_zzip = xyes; then
AC_DEFINE(HAVE_ZZIP, 1, [Define to have zip archive support])
AC_PATH_PROG(ZIP, zip, no)
else
ZIP="no"
fi
AM_CONDITIONAL(ENABLE_ZZIP_TEST, test x$ZIP != xno)
dnl iso9660
AC_ARG_ENABLE(iso9660,
AS_HELP_STRING([--enable-iso9660],
@ -381,8 +393,14 @@ MPD_AUTO_PKG(iso9660, ISO9660, [libiso9660],
AM_CONDITIONAL(HAVE_ISO9660, test x$enable_iso9660 = xyes)
if test x$enable_iso9660 = xyes; then
AC_DEFINE(HAVE_ISO9660, 1, [Define to have ISO9660 archive support])
AC_PATH_PROG(MKISOFS, mkisofs, no)
else
MKISOFS="no"
fi
AM_CONDITIONAL(ENABLE_ISO9660_TEST, test x$MKISOFS != xno)
dnl archive API
if
test x$enable_bzip2 = xyes ||

10
test/test_archive_bzip2.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh -e
SRC_BASE=configure
SRC="$(dirname $0)/../${SRC_BASE}"
DST="$(pwd)/test/tmp/${SRC_BASE}.bz2"
mkdir -p test/tmp
rm -f "$DST"
bzip2 -c "$SRC" >"$DST"
./test/run_input "$DST/${SRC_BASE}" |diff "$SRC" -

10
test/test_archive_iso9660.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh -e
SRC_BASE=configure
SRC="$(dirname $0)/../${SRC_BASE}"
DST="$(pwd)/test/tmp/${SRC_BASE}.iso"
mkdir -p test/tmp
rm -f "$DST"
mkisofs -quiet -l -o "$DST" "$SRC"
./test/run_input "$DST/${SRC_BASE}" |diff "$SRC" -

10
test/test_archive_zzip.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh -e
SRC_BASE=configure
SRC="$(dirname $0)/../${SRC_BASE}"
DST="$(pwd)/test/tmp/${SRC_BASE}.zip"
mkdir -p test/tmp
rm -f "$DST"
zip --quiet --junk-paths "$DST" "$SRC"
./test/run_input "$DST/${SRC_BASE}" |diff "$SRC" -