summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-07-23 22:13:41 (GMT)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-07-28 07:05:21 (GMT)
commitfe3efcb4695fd11c66b8d6c78836faae9e2aa828 (patch)
tree9ff023682666d34eb010ac88af72d30e4d957a5b
parentdb6d910d071bf824db97d4b6273c876b65f71774 (diff)
downloadgst-plugins-dlnasrc-fe3efcb4695fd11c66b8d6c78836faae9e2aa828.tar.gz
gst-plugins-dlnasrc-fe3efcb4695fd11c66b8d6c78836faae9e2aa828.tar.xz
add tests infrastructure
-rw-r--r--.gitignore5
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac3
-rw-r--r--src/Makefile.am14
-rw-r--r--tests/Makefile.am16
-rw-r--r--tests/test-util.c16
6 files changed, 49 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 7c71444..2da859d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,4 +32,7 @@ test/*.log
test/*.out
test/tmp
bug
-
+test-driver
+tests/*.log
+tests/*.trs
+tests/test-util
diff --git a/Makefile.am b/Makefile.am
index 9ce812d..abe10b9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,2 +1,2 @@
-SUBDIRS = src
+SUBDIRS = src tests
EXTRA_DIST = autogen.sh
diff --git a/configure.ac b/configure.ac
index 773cabf..37f9ca4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,6 +99,7 @@ AC_SUBST(GST_PLUGIN_LDFLAGS)
AC_CONFIG_FILES([
Makefile \
- src/Makefile])
+ src/Makefile \
+ tests/Makefile])
AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index 8a5ef55..75b7078 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -14,19 +14,25 @@ plugin_LTLIBRARIES = libgstdlnasrc.la
##############################################################################
# sources used to compile this plug-in
-libgstdlnasrc_la_SOURCES = \
+sources = \
gstdlnasrc.c \
gstdlnasrc.h \
util.c \
util.h
+AM_CFLAGS = $(GST_CFLAGS) $(SOUP_CFLAGS)
+
# compiler and linker flags used to compile this plugin, set in configure.ac
-libgstdlnasrc_la_CFLAGS = $(GST_CFLAGS) $(SOUP_CFLAGS)
-libgstdlnasrc_la_CXXFLAGS = $(GST_CFLAGS)
-libgstdlnasrc_la_LIBADD = $(GST_LIBS) $(SOUP_LIBS)
+libgstdlnasrc_la_SOURCES = $(sources)
libgstdlnasrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+libgstdlnasrc_la_LIBADD = $(GST_LIBS) $(SOUP_LIBS)
libgstdlnasrc_la_LIBTOOLFLAGS = --tag=disable-static
+# convenient internal lib used for tests
+libdlnasrc_internal_la_SOURCES = $(sources)
+
+noinst_LTLIBRARIES = libdlnasrc-internal.la
+
# headers we need but don't want installed
noinst_HEADERS = \
gstdlnasrc.h \
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..ddd67a2
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,16 @@
+programs_list = \
+ test-util
+
+AM_CFLAGS = \
+ -I${top_srcdir}/src -I${top_builddir}/src \
+ $(GST_CFLAGS) $(SOUP_CFLAGS)
+AM_LDFLAGS = \
+ $(GST_LIBS) \
+ $(SOUP_LIBS) \
+ $(GST_PLUGIN_LDFLAGS)
+LDADD = \
+ $(top_builddir)/src/libdlnasrc-internal.la
+
+noinst_PROGRAMS = $(programs_list)
+
+TESTS = $(programs_list)
diff --git a/tests/test-util.c b/tests/test-util.c
new file mode 100644
index 0000000..944d0bc
--- /dev/null
+++ b/tests/test-util.c
@@ -0,0 +1,16 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <glib.h>
+
+#include "util.h"
+
+int
+main (int argc,
+ char **argv)
+{
+ g_test_init (&argc, &argv, NULL);
+
+ return g_test_run ();
+}