player: Add unit test that is disabled by default

The unit test is downloading a few small media files from the Internet,
which are then used during the test. "make clean" removes the files again.
This commit is contained in:
Sebastian Dröge 2015-12-23 09:55:26 +01:00
parent d16eb47cca
commit 2f86923cbd
3 changed files with 1548 additions and 1 deletions

View file

@ -396,6 +396,17 @@ fi
AC_SUBST(GST_PLUGIN_LIBTOOLFLAGS)
AM_CONDITIONAL(GST_PLUGIN_BUILD_STATIC, test "x$enable_static_plugins" = "xyes")
AC_ARG_WITH([player-tests],
AS_HELP_STRING([--with-player-tests],[Enable GstPlayer tests that need network access (default: no)]))
if test x$with_player_tests = xyes; then
AC_PATH_PROG([WGET], [wget], no)
if test x$WGET = xno; then
AC_MSG_WARN([wget required for GstPlayer tests but not found - disabling])
with_player_tests=no
fi
fi
AM_CONDITIONAL(WITH_GST_PLAYER_TESTS, test "x$with_player_tests" = "xyes")
# set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
dnl make sure it doesn't complain about unused variables if debugging is disabled
NO_WARNINGS=""

View file

@ -176,6 +176,12 @@ check_hlsdemux_m3u8 =
check_hlsdemux =
endif
if WITH_GST_PLAYER_TESTS
check_player = libs/player
else
check_player =
endif
if USE_CURL
check_curl = elements/curlhttpsink \
elements/curlfilesink \
@ -291,7 +297,8 @@ check_PROGRAMS = \
libs/insertbin \
$(check_gl) \
$(check_hlsdemux_m3u8) \
$(check_hls_demux) \
$(check_hlsdemux) \
$(check_player) \
$(EXPERIMENTAL_CHECKS)
noinst_HEADERS = elements/mxfdemux.h
@ -470,6 +477,36 @@ libs_insertbin_LDADD = \
libs_insertbin_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AM_CFLAGS)
libs_player_SOURCES = libs/player.c
libs_player_LDADD = \
$(top_builddir)/gst-libs/gst/player/libgstplayer-@GST_API_VERSION@.la \
$(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) $(LDADD)
libs_player_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AM_CFLAGS) \
-DTEST_PATH=\"$(builddir)/media\"
if WITH_GST_PLAYER_TESTS
PLAYER_MEDIA_FILES = \
media/audio.ogg \
media/audio-video.ogg \
media/audio-short.ogg \
media/audio-video-short.ogg \
media/sintel.mkv \
media/test_sub.srt
$(PLAYER_MEDIA_FILES):
$(MKDIR_P) media
$(WGET) -c http://gstreamer.freedesktop.org/data/media/small/$(subst media/,,$@) -O media/$(subst media/,,$@)
libs/player_dummy.c: $(PLAYER_MEDIA_FILES)
touch libs/player_dummy.c
nodist_libs_player_SOURCES = libs/player_dummy.c
CLEANFILES += $(PLAYER_MEDIA_FILES) libs/player_dummy.c
endif
elements_rtponvifparse_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(AM_CFLAGS)
elements_rtponvifparse_LDADD = $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) -lgstrtp-$(GST_API_VERSION) $(LDADD)

1499
tests/check/libs/player.c Normal file

File diff suppressed because it is too large Load diff