summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@noraisin.net>2009-04-17 13:46:39 +0100
committerJan Schmidt <thaytan@noraisin.net>2009-04-17 13:46:39 +0100
commita3d1cfe2474a49ae5cb1cc7d3273528e6aa58a3c (patch)
treef20194d510da035b551a891964bd8f3dc5d8d288
parentcbea9841ecaa4ec82286ab307e3b8aff4b3fb162 (diff)
check: Add a simple test that the FFmpeg plugin loads
Check that the ffmpeg plugin actually exists after building.
-rw-r--r--tests/check/Makefile.am2
-rw-r--r--tests/check/generic/.gitignore1
-rw-r--r--tests/check/generic/plugin-test.c71
3 files changed, 74 insertions, 0 deletions
diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
index 9351466..e417c0c 100644
--- a/tests/check/Makefile.am
+++ b/tests/check/Makefile.am
@@ -16,9 +16,11 @@ CLEANFILES = core.* test-registry.xml
clean-local: clean-local-check
check_PROGRAMS = \
+ generic/plugin-test \
generic/libavcodec-locking
VALGRIND_TO_FIX = \
+ generic/plugin-test \
generic/libavcodec-locking
TESTS = $(check_PROGRAMS)
diff --git a/tests/check/generic/.gitignore b/tests/check/generic/.gitignore
index 36c1981..d79329a 100644
--- a/tests/check/generic/.gitignore
+++ b/tests/check/generic/.gitignore
@@ -1,2 +1,3 @@
.dirstamp
libavcodec-locking
+plugin-test
diff --git a/tests/check/generic/plugin-test.c b/tests/check/generic/plugin-test.c
new file mode 100644
index 0000000..7c35847
--- /dev/null
+++ b/tests/check/generic/plugin-test.c
@@ -0,0 +1,71 @@
+/* GStreamer
+ * Copyright (C) 2009 Jan Schmidt <thaytan@noraisin.net>
+ *
+ * Test that the FFmpeg plugin is loadable, and not broken in some stupid
+ * way.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+
+#include <gst/check/gstcheck.h>
+#include <stdlib.h>
+
+GST_START_TEST (test_ffmpeg_plugin)
+{
+ GstPlugin *plugin = gst_plugin_load_by_name ("ffmpeg");
+
+ fail_if (plugin == NULL, "Could not load FFmpeg plugin");
+
+ gst_object_unref (plugin);
+
+}
+
+GST_END_TEST;
+
+Suite *
+plugin_test_suite (void)
+{
+ gint timeout = 0;
+
+ Suite *s = suite_create ("Plugin");
+ TCase *tc_chain = tcase_create ("existence");
+
+ suite_add_tcase (s, tc_chain);
+
+ tcase_add_test (tc_chain, test_ffmpeg_plugin);
+
+ return s;
+}
+
+int
+main (int argc, char **argv)
+{
+ SRunner *sr;
+ Suite *s;
+ int nf;
+
+ gst_check_init (&argc, &argv);
+
+ s = plugin_test_suite ();
+ sr = srunner_create (s);
+
+ srunner_run_all (sr, CK_NORMAL);
+ nf = srunner_ntests_failed (sr);
+ srunner_free (sr);
+
+ return nf;
+}