diff --git a/gst/gst.c b/gst/gst.c index 9697ce2e7d..2451dc939e 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -373,8 +373,15 @@ init_pre (void) gst_registry_add_path (_global_registry, PLUGINS_DIR); #endif /* PLUGINS_USE_BUILDDIR */ - homedir = g_get_home_dir (); - user_reg = g_strjoin ("/", homedir, LOCAL_REGISTRY_FILE, NULL); + if (g_getenv ("GST_REGISTRY")) + { + user_reg = g_strdup (g_getenv ("GST_REGISTRY")); + } + else + { + homedir = g_get_home_dir (); + user_reg = g_strjoin ("/", homedir, LOCAL_REGISTRY_FILE, NULL); + } _user_registry = gst_xml_registry_new ("user_registry", user_reg); g_free (user_reg); diff --git a/tests/old/testsuite/Makefile.am b/tests/old/testsuite/Makefile.am index 3748b1dcbe..9f068af9db 100644 --- a/tests/old/testsuite/Makefile.am +++ b/tests/old/testsuite/Makefile.am @@ -7,8 +7,8 @@ endif # FIXME : threads bytestream SUBDIRS = caps plugin elements clock refcounting threads indexers $(GST_PARSE_DIRS) ## cleanup dynparams -GST_PLUGIN_PATH = $(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`/test-registry.xml +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml if BUILD_FAILING_TESTS testprogs = test_gst_init @@ -18,7 +18,10 @@ testprogs = inspectcheck = endif -TESTS = $(top_builddir)/tools/gst-register $(testprogs) $(inspectcheck) +# since these TESTS are only run after recursing into subdirs, +# gst-register should be run before that, in the first subdir that uses it +# TESTS = $(top_builddir)/tools/gst-register $(testprogs) $(inspectcheck) +TESTS = $(testprogs) $(inspectcheck) check_PROGRAMS = $(testprogs) @@ -27,7 +30,7 @@ LIBS = $(GST_LIBS) AM_CFLAGS = $(GST_CFLAGS) # we makes them, we gots to clean them -CLEANFILES = test-registry.xml elementstest-registry.xml +CLEANFILES = test-registry.xml DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \ plugin refcounting threads parse diff --git a/tests/old/testsuite/caps/Makefile.am b/tests/old/testsuite/caps/Makefile.am index 710bddd979..8d13f8d608 100644 --- a/tests/old/testsuite/caps/Makefile.am +++ b/tests/old/testsuite/caps/Makefile.am @@ -1,9 +1,12 @@ -GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml testprogs = intersection compatibility normalisation string-conversions -TESTS = $(testprogs) +# we run gst-register here, which is a HACK to generate the test registry +# before we actually run the real tests +# a better fix is welcome :) +TESTS = $(top_builddir)/tools/gst-register $(testprogs) check_PROGRAMS = $(testprogs) diff --git a/tests/old/testsuite/cleanup/Makefile.am b/tests/old/testsuite/cleanup/Makefile.am index 9a2bac9a7a..f59c691567 100644 --- a/tests/old/testsuite/cleanup/Makefile.am +++ b/tests/old/testsuite/cleanup/Makefile.am @@ -1,3 +1,6 @@ +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml + if BUILD_FAILING_TESTS FAILING = cleanup3 cleanup4 else @@ -6,9 +9,6 @@ endif testprogs = cleanup1 cleanup2 $(FAILING) cleanup5 -GST_PLUGIN_PATH = $(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`/test-registry.xml - TESTS = $(testprogs) check_PROGRAMS = $(testprogs) diff --git a/tests/old/testsuite/clock/Makefile.am b/tests/old/testsuite/clock/Makefile.am index 02b252f25c..21c3ce7387 100644 --- a/tests/old/testsuite/clock/Makefile.am +++ b/tests/old/testsuite/clock/Makefile.am @@ -1,5 +1,5 @@ -GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml testprogs = clock1 clock2 diff --git a/tests/old/testsuite/elements/Makefile.am b/tests/old/testsuite/elements/Makefile.am index c4dd8052fe..af78be0617 100644 --- a/tests/old/testsuite/elements/Makefile.am +++ b/tests/old/testsuite/elements/Makefile.am @@ -1,3 +1,6 @@ +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml + if BUILD_FAILING_TESTS tests_failing = fake else @@ -5,10 +8,6 @@ tests_failing = endif tests_working = name tee property -GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) - -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`test-registry.xml - TESTS = $(tests_working) check_PROGRAMS = $(tests_failing) $(tests_working) diff --git a/tests/old/testsuite/indexers/Makefile.am b/tests/old/testsuite/indexers/Makefile.am index e08c185807..e1c8d6e363 100644 --- a/tests/old/testsuite/indexers/Makefile.am +++ b/tests/old/testsuite/indexers/Makefile.am @@ -1,3 +1,6 @@ +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml + testprogs = cache1 indexdump TESTS = $(testprogs) diff --git a/tests/old/testsuite/plugin/Makefile.am b/tests/old/testsuite/plugin/Makefile.am index 363c6851cb..7cda5cea31 100644 --- a/tests/old/testsuite/plugin/Makefile.am +++ b/tests/old/testsuite/plugin/Makefile.am @@ -1,7 +1,7 @@ -plugindir = $(shell cd $(top_builddir)/testsuite/plugin/ && pwd) +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml -GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml +plugindir = $(shell cd $(top_builddir)/testsuite/plugin/ && pwd) plugin_LTLIBRARIES = libtestplugin.la libtestplugin2.la diff --git a/tests/old/testsuite/refcounting/Makefile.am b/tests/old/testsuite/refcounting/Makefile.am index 0413c20347..b7fbe22361 100644 --- a/tests/old/testsuite/refcounting/Makefile.am +++ b/tests/old/testsuite/refcounting/Makefile.am @@ -1,3 +1,6 @@ +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml + if BUILD_FAILING_TESTS tests_failing = element bin element_pad pad else @@ -11,9 +14,6 @@ pad_SOURCES = pad.c mem.c element_pad_SOURCES = element_pad.c mem.c bin_SOURCES = bin.c mem.c -GST_PLUGIN_PATH = $(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`/test-registry.xml - TESTS = $(tests_working) check_PROGRAMS = $(TESTS) diff --git a/tests/old/testsuite/threads/Makefile.am b/tests/old/testsuite/threads/Makefile.am index 0184989f78..97112c8323 100644 --- a/tests/old/testsuite/threads/Makefile.am +++ b/tests/old/testsuite/threads/Makefile.am @@ -1,3 +1,6 @@ +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml + testprogs = thread1 thread2 thread3 thread5 threadb testsfailing = threadc threadd threade threadf thread4 @@ -7,10 +10,6 @@ check_PROGRAMS = $(testprogs) noinst_PROGRAMS = $(testsfailing) -GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) - -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`test-registry.xml - LDADD = $(GST_LIBS) AM_CFLAGS = $(GST_CFLAGS) diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 3748b1dcbe..9f068af9db 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -7,8 +7,8 @@ endif # FIXME : threads bytestream SUBDIRS = caps plugin elements clock refcounting threads indexers $(GST_PARSE_DIRS) ## cleanup dynparams -GST_PLUGIN_PATH = $(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`/test-registry.xml +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml if BUILD_FAILING_TESTS testprogs = test_gst_init @@ -18,7 +18,10 @@ testprogs = inspectcheck = endif -TESTS = $(top_builddir)/tools/gst-register $(testprogs) $(inspectcheck) +# since these TESTS are only run after recursing into subdirs, +# gst-register should be run before that, in the first subdir that uses it +# TESTS = $(top_builddir)/tools/gst-register $(testprogs) $(inspectcheck) +TESTS = $(testprogs) $(inspectcheck) check_PROGRAMS = $(testprogs) @@ -27,7 +30,7 @@ LIBS = $(GST_LIBS) AM_CFLAGS = $(GST_CFLAGS) # we makes them, we gots to clean them -CLEANFILES = test-registry.xml elementstest-registry.xml +CLEANFILES = test-registry.xml DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \ plugin refcounting threads parse diff --git a/testsuite/caps/Makefile.am b/testsuite/caps/Makefile.am index 710bddd979..8d13f8d608 100644 --- a/testsuite/caps/Makefile.am +++ b/testsuite/caps/Makefile.am @@ -1,9 +1,12 @@ -GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml testprogs = intersection compatibility normalisation string-conversions -TESTS = $(testprogs) +# we run gst-register here, which is a HACK to generate the test registry +# before we actually run the real tests +# a better fix is welcome :) +TESTS = $(top_builddir)/tools/gst-register $(testprogs) check_PROGRAMS = $(testprogs) diff --git a/testsuite/cleanup/Makefile.am b/testsuite/cleanup/Makefile.am index 9a2bac9a7a..f59c691567 100644 --- a/testsuite/cleanup/Makefile.am +++ b/testsuite/cleanup/Makefile.am @@ -1,3 +1,6 @@ +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml + if BUILD_FAILING_TESTS FAILING = cleanup3 cleanup4 else @@ -6,9 +9,6 @@ endif testprogs = cleanup1 cleanup2 $(FAILING) cleanup5 -GST_PLUGIN_PATH = $(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`/test-registry.xml - TESTS = $(testprogs) check_PROGRAMS = $(testprogs) diff --git a/testsuite/clock/Makefile.am b/testsuite/clock/Makefile.am index 02b252f25c..21c3ce7387 100644 --- a/testsuite/clock/Makefile.am +++ b/testsuite/clock/Makefile.am @@ -1,5 +1,5 @@ -GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml testprogs = clock1 clock2 diff --git a/testsuite/elements/Makefile.am b/testsuite/elements/Makefile.am index c4dd8052fe..af78be0617 100644 --- a/testsuite/elements/Makefile.am +++ b/testsuite/elements/Makefile.am @@ -1,3 +1,6 @@ +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml + if BUILD_FAILING_TESTS tests_failing = fake else @@ -5,10 +8,6 @@ tests_failing = endif tests_working = name tee property -GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) - -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`test-registry.xml - TESTS = $(tests_working) check_PROGRAMS = $(tests_failing) $(tests_working) diff --git a/testsuite/indexers/Makefile.am b/testsuite/indexers/Makefile.am index e08c185807..e1c8d6e363 100644 --- a/testsuite/indexers/Makefile.am +++ b/testsuite/indexers/Makefile.am @@ -1,3 +1,6 @@ +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml + testprogs = cache1 indexdump TESTS = $(testprogs) diff --git a/testsuite/plugin/Makefile.am b/testsuite/plugin/Makefile.am index 363c6851cb..7cda5cea31 100644 --- a/testsuite/plugin/Makefile.am +++ b/testsuite/plugin/Makefile.am @@ -1,7 +1,7 @@ -plugindir = $(shell cd $(top_builddir)/testsuite/plugin/ && pwd) +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml -GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml +plugindir = $(shell cd $(top_builddir)/testsuite/plugin/ && pwd) plugin_LTLIBRARIES = libtestplugin.la libtestplugin2.la diff --git a/testsuite/refcounting/Makefile.am b/testsuite/refcounting/Makefile.am index 0413c20347..b7fbe22361 100644 --- a/testsuite/refcounting/Makefile.am +++ b/testsuite/refcounting/Makefile.am @@ -1,3 +1,6 @@ +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml + if BUILD_FAILING_TESTS tests_failing = element bin element_pad pad else @@ -11,9 +14,6 @@ pad_SOURCES = pad.c mem.c element_pad_SOURCES = element_pad.c mem.c bin_SOURCES = bin.c mem.c -GST_PLUGIN_PATH = $(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`/test-registry.xml - TESTS = $(tests_working) check_PROGRAMS = $(TESTS) diff --git a/testsuite/threads/Makefile.am b/testsuite/threads/Makefile.am index 0184989f78..97112c8323 100644 --- a/testsuite/threads/Makefile.am +++ b/testsuite/threads/Makefile.am @@ -1,3 +1,6 @@ +TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) +TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml + testprogs = thread1 thread2 thread3 thread5 threadb testsfailing = threadc threadd threade threadf thread4 @@ -7,10 +10,6 @@ check_PROGRAMS = $(testprogs) noinst_PROGRAMS = $(testsfailing) -GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) - -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`test-registry.xml - LDADD = $(GST_LIBS) AM_CFLAGS = $(GST_CFLAGS)