summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2009-05-15 17:11:27 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-05-15 17:17:20 +0100
commitc014c4a621e1119ef8e2ca564de97878529b7197 (patch)
tree1d46c03f2b0e4a79d0806c116a578d905a05d3e5 /tests
parentad9b02b881e2f6dca0133a4831ee640d92701f41 (diff)
checks: move files required by unit tests into tests/files and make sure they're disted
Move unit test data into the directory where it belongs and make in particular the flacdec unit test cd into the directory with the test files instead of making assumptions about the current working directory in that unit test. As a side effect of movng those files, there's only one EXTRA_DIST in tests/check/Makefile.am now, which is likely to work better than having two. Hopefully fixes #582753.
Diffstat (limited to 'tests')
-rw-r--r--tests/check/Makefile.am8
-rw-r--r--tests/check/elements/id3demux.c6
-rw-r--r--tests/check/elements/souphttpsrc.c4
-rw-r--r--tests/check/pipelines/flacdec.c27
-rw-r--r--tests/files/Makefile.am5
-rw-r--r--tests/files/audiotestsrc.flac (renamed from tests/check/audiotestsrc.flac)bin4708 -> 4708 bytes
-rw-r--r--tests/files/test-cert.pem (renamed from tests/check/test-cert.pem)0
-rw-r--r--tests/files/test-key.pem (renamed from tests/check/test-key.pem)0
8 files changed, 19 insertions, 31 deletions
diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
index 88e8c16b..22d0a492 100644
--- a/tests/check/Makefile.am
+++ b/tests/check/Makefile.am
@@ -10,11 +10,8 @@ TESTS_ENVIRONMENT = \
$(REGISTRY_ENVIRONMENT) \
GST_PLUGIN_SYSTEM_PATH= \
GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/ext:$(top_builddir)/sys:$(GSTPB_PLUGINS_DIR):$(GST_PLUGINS_DIR) \
- GST_TEST_FILES_PATH=$(TEST_FILES_DIRECTORY) \
STATE_IGNORE_ELEMENTS="aasink autoaudiosrc autoaudiosink autovideosrc autovideosink cacasink cairotextoverlay gconfaudiosrc gconfvideosrc gconfaudiosink gconfvideosink halaudiosrc halaudiosink v4l2src osssrc osssink pulsesink pulsesrc pulsemixer"
-EXTRA_DIST = test-cert.pem test-key.pem audiotestsrc.flac
-
# ths core dumps of some machines have PIDs appended
CLEANFILES = core.* test-registry.*
@@ -115,7 +112,8 @@ TESTS = $(check_PROGRAMS)
noinst_PROGRAMS = \
elements/autodetect
-AM_CFLAGS = $(GST_OBJ_CFLAGS) $(GST_CHECK_CFLAGS) $(CHECK_CFLAGS) $(GST_OPTION_CFLAGS)
+AM_CFLAGS = $(GST_OBJ_CFLAGS) $(GST_CHECK_CFLAGS) $(CHECK_CFLAGS) \
+ $(GST_OPTION_CFLAGS) -DGST_TEST_FILES_PATH="\"$(TEST_FILES_DIRECTORY)\""
LDADD = $(GST_OBJ_LIBS) $(GST_CHECK_LIBS) $(CHECK_LIBS)
# valgrind testing
@@ -147,7 +145,7 @@ elements_deinterleave_LDADD = $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMIN
elements_interleave_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(CFLAGS) $(AM_CFLAGS)
elements_interleave_LDADD = $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) $(LDADD)
-elements_souphttpsrc_CFLAGS = -DCHECKDATA_DIR="$(srcdir)" $(SOUP_CFLAGS) $(AM_CFLAGS)
+elements_souphttpsrc_CFLAGS = $(SOUP_CFLAGS) $(AM_CFLAGS)
elements_souphttpsrc_LDADD = $(SOUP_LIBS) $(LDADD)
elements_sunaudio_CFLAGS = \
diff --git a/tests/check/elements/id3demux.c b/tests/check/elements/id3demux.c
index a3eb77b4..ef1d4538 100644
--- a/tests/check/elements/id3demux.c
+++ b/tests/check/elements/id3demux.c
@@ -59,7 +59,6 @@ read_tags_from_file (const gchar * file, gboolean push_mode)
GstMessage *msg;
GstElement *src, *sep, *sink, *id3demux, *pipeline;
GstBus *bus;
- const gchar *dir;
gchar *path;
pipeline = gst_pipeline_new ("pipeline");
@@ -96,10 +95,7 @@ read_tags_from_file (const gchar * file, gboolean push_mode)
/* can't link id3demux and sink yet, do that later */
g_signal_connect (id3demux, "pad-added", G_CALLBACK (pad_added_cb), pipeline);
- dir = g_getenv ("GST_TEST_FILES_PATH");
- fail_unless (dir != NULL, "GST_TEST_FILES_PATH environment variable not set");
-
- path = g_build_filename (dir, file, NULL);
+ path = g_build_filename (GST_TEST_FILES_PATH, file, NULL);
GST_LOG ("reading file '%s'", path);
g_object_set (src, "location", path, NULL);
diff --git a/tests/check/elements/souphttpsrc.c b/tests/check/elements/souphttpsrc.c
index 01123699..3c6f5199 100644
--- a/tests/check/elements/souphttpsrc.c
+++ b/tests/check/elements/souphttpsrc.c
@@ -563,8 +563,8 @@ run_server (guint * http_port, guint * https_port)
SoupServer *server, *ssl_server;
guint port = SOUP_ADDRESS_ANY_PORT;
guint ssl_port = SOUP_ADDRESS_ANY_PORT;
- const char *ssl_cert_file = G_STRINGIFY (CHECKDATA_DIR) "/test-cert.pem";
- const char *ssl_key_file = G_STRINGIFY (CHECKDATA_DIR) "/test-key.pem";
+ const char *ssl_cert_file = GST_TEST_FILES_PATH "/test-cert.pem";
+ const char *ssl_key_file = GST_TEST_FILES_PATH "/test-key.pem";
static int server_running = 0;
SoupAuthDomain *domain = NULL;
diff --git a/tests/check/pipelines/flacdec.c b/tests/check/pipelines/flacdec.c
index 31710255..ced6c343 100644
--- a/tests/check/pipelines/flacdec.c
+++ b/tests/check/pipelines/flacdec.c
@@ -18,6 +18,7 @@
*/
#include <gst/check/gstcheck.h>
+#include <glib/gstdio.h>
static guint16
buffer_get_first_sample (GstBuffer * buf)
@@ -60,6 +61,8 @@ GST_START_TEST (test_decode)
guint16 first_sample = 0;
guint size = 0;
+ fail_unless_equals_int (g_chdir (GST_TEST_FILES_PATH), 0);
+
pipeline = gst_parse_launch ("filesrc location=audiotestsrc.flac"
" ! flacdec ! appsink name=sink", NULL);
fail_unless (pipeline != NULL);
@@ -105,6 +108,8 @@ GST_START_TEST (test_decode_seek_full)
gboolean result;
guint size = 0;
+ fail_unless_equals_int (g_chdir (GST_TEST_FILES_PATH), 0);
+
pipeline = gst_parse_launch ("filesrc location=audiotestsrc.flac"
" ! flacdec ! appsink name=sink", NULL);
fail_unless (pipeline != NULL);
@@ -158,6 +163,8 @@ GST_START_TEST (test_decode_seek_partial)
guint size = 0;
guint16 first_sample = 0;
+ fail_unless_equals_int (g_chdir (GST_TEST_FILES_PATH), 0);
+
pipeline = gst_parse_launch ("filesrc location=audiotestsrc.flac"
" ! flacdec ! appsink name=sink", NULL);
fail_unless (pipeline != NULL);
@@ -206,7 +213,7 @@ GST_START_TEST (test_decode_seek_partial)
GST_END_TEST;
-Suite *
+static Suite *
flacdec_suite (void)
{
Suite *s = suite_create ("flacdec");
@@ -224,20 +231,4 @@ flacdec_suite (void)
return s;
}
-int
-main (int argc, char **argv)
-{
- int nf;
-
- Suite *s = flacdec_suite ();
-
- SRunner *sr = srunner_create (s);
-
- gst_check_init (&argc, &argv);
-
- srunner_run_all (sr, CK_NORMAL);
- nf = srunner_ntests_failed (sr);
- srunner_free (sr);
-
- return nf;
-}
+GST_CHECK_MAIN (flacdec);
diff --git a/tests/files/Makefile.am b/tests/files/Makefile.am
index dae803a2..4f3d3a43 100644
--- a/tests/files/Makefile.am
+++ b/tests/files/Makefile.am
@@ -1,7 +1,10 @@
EXTRA_DIST = \
+ audiotestsrc.flac \
id3-407349-1.tag \
id3-407349-2.tag \
id3-447000-wcop.tag \
- id3-577468-unsynced-tag.tag
+ id3-577468-unsynced-tag.tag \
+ test-cert.pem \
+ test-key.pem
diff --git a/tests/check/audiotestsrc.flac b/tests/files/audiotestsrc.flac
index 2f12c3f7..2f12c3f7 100644
--- a/tests/check/audiotestsrc.flac
+++ b/tests/files/audiotestsrc.flac
Binary files differ
diff --git a/tests/check/test-cert.pem b/tests/files/test-cert.pem
index a6b66083..a6b66083 100644
--- a/tests/check/test-cert.pem
+++ b/tests/files/test-cert.pem
diff --git a/tests/check/test-key.pem b/tests/files/test-key.pem
index 9bea9bf2..9bea9bf2 100644
--- a/tests/check/test-key.pem
+++ b/tests/files/test-key.pem