[rygel-gst-0-10-plugins] Add a simple test



commit e67848e4c1be9fec68b067833590bcef16a1b906
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jan 10 09:20:50 2013 +0100

    Add a simple test

 Makefile.am         |    2 +-
 configure.ac        |    1 +
 tests/Makefile.am   |   12 ++++++++++++
 tests/test_simple.c |   45 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 59 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 5c4366f..0933d91 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = src data po
+SUBDIRS = src data tests po
 
 
 DISTCHECK_CONFIGURE_FLAGS =
diff --git a/configure.ac b/configure.ac
index aab26ed..89be903 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,7 @@ Makefile
 data/Makefile
 src/Makefile
 src/media-export/Makefile
+tests/Makefile
 po/Makefile.in
 ])
 AC_OUTPUT
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..87545cc
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,12 @@
+noinst_PROGRAMS = test_simple
+test_simple_SOURCES = test_simple.c
+test_simple_CFLAGS = \
+	$(DEPS_CFLAGS) \
+	-I$(top_builddir)/src -I$(top_srcdir)/src
+test_simple_LDADD = \
+	$(DEPS_LIBS) \
+	$(top_builddir)/src/librygel-media-engine-gst-0-10.la
+
+
+check_PROGRAMS = test_simple
+TESTS = test_simple
diff --git a/tests/test_simple.c b/tests/test_simple.c
new file mode 100644
index 0000000..52a0ad1
--- /dev/null
+++ b/tests/test_simple.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2012 Intel Corporation
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "rygel-gst-media-export-plugin.h"
+
+int main(int argc, char *argv[])
+{
+#if !GLIB_CHECK_VERSION(2,35,0)
+  g_type_init ();
+#endif
+  gst_init (&argc, &argv);
+
+  /* Some very simple checks that the plugin can be instantiated
+   * and used in very simple ways.
+   */
+  RygelMediaServerPlugin *plugin = module_init ();
+  g_assert (plugin);
+  g_assert (RYGEL_MEDIA_EXPORT_PLUGIN (plugin));
+
+  RygelMediaContainer *root_container = rygel_media_server_plugin_get_root_container (plugin);
+  g_assert (root_container);
+  g_assert (RYGEL_MEDIA_EXPORT_ROOT_CONTAINER (root_container));
+
+  g_object_unref (root_container);
+  g_object_unref (plugin);
+
+  return 0;
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]