diff options
author | David Schleef <ds@schleef.org> | 2003-10-15 01:25:41 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2003-10-15 01:25:41 +0000 |
commit | 9c87c528e72178dd9357a8ff9c958d9fdac562ef (patch) | |
tree | 412df932e3645998493ea7d08fa63735c3f15358 | |
parent | dcb2dce108c378240fbbc0321e19e969fe3dbe79 (diff) |
Massive patch to make 'make check' work properly. Many compilation fixes -- everything should compile now. Some tes...
Original commit message from CVS:
Massive patch to make 'make check' work properly. Many compilation
fixes -- everything should compile now. Some tests pass, some
fail; the expected sucess/failure is coded in the Makefile.am's.
gst-register is properly run for both 'make check' and 'make distcheck'.
Much of the common infrastructure is coded in testsuite/Rules.
58 files changed, 476 insertions, 532 deletions
diff --git a/tests/old/testsuite/Makefile.am b/tests/old/testsuite/Makefile.am index 3dbaa23de..0e181893d 100644 --- a/tests/old/testsuite/Makefile.am +++ b/tests/old/testsuite/Makefile.am @@ -1,3 +1,6 @@ +include Rules + + if GST_DISABLE_PARSE GST_PARSE_DIRS = else @@ -10,35 +13,18 @@ else GST_DEBUG_DIRS = debug endif -# FIXME : threads bytestream -SUBDIRS = caps plugin elements clock refcounting threads indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) ## cleanup dynparams - -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 -inspectcheck = gst-inspect-check -else -testprogs = -inspectcheck = -endif - -# 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) +SUBDIRS = bytestream cleanup dynparams \ + caps plugin elements clock refcounting threads \ + indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) -check_PROGRAMS = $(testprogs) +DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \ + plugin refcounting threads parse debug -# we have nothing but apps here, we can do this safely -LIBS = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) +tests_pass = test_gst_init +tests_fail = # we makes them, we gots to clean them -CLEANFILES = test-registry.xml - -DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \ - plugin refcounting threads parse debug +CLEANFILES += test-registry.xml EXTRA_DIST = gst-inspect-check + diff --git a/tests/old/testsuite/Rules b/tests/old/testsuite/Rules new file mode 100644 index 000000000..dbde51105 --- /dev/null +++ b/tests/old/testsuite/Rules @@ -0,0 +1,24 @@ + +TESTS_ENVIRONMENT=\ + G_DEBUG=fatal_warnings \ + GST_PLUGIN_PATH=$(top_builddir) \ + GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml + + +plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ + +check_PROGRAMS = $(tests_pass) $(tests_fail) + +TESTS = $(top_builddir)/tools/gst-register $(tests_pass) $(tests_fail) +XFAIL_TESTS = $(tests_fail) + +AM_CFLAGS = $(GST_CFLAGS) +LIBS = $(GST_LIBS) + +# override to _not_ install the test plugins +install-pluginLTLIBRARIES: + +# This rule is here so make distcheck works on machines where core +# dumps have PIDs appended +CLEANFILES = core.* + diff --git a/tests/old/testsuite/bytestream/Makefile.am b/tests/old/testsuite/bytestream/Makefile.am index 696ad9822..317e3d46b 100644 --- a/tests/old/testsuite/bytestream/Makefile.am +++ b/tests/old/testsuite/bytestream/Makefile.am @@ -1,11 +1,8 @@ -## filterdir = $(libdir)/gst +include ../Rules -testprogs = test1 +tests_pass = +tests_fail = test1 -check_PROGRAMS = $(testprogs) +test1_SOURCES = test1.c gstbstest.c -test1_SOURCES = test1.c gstbstest.c mem.c -test1_CFLAGS = $(GST_CFLAGS) -test1_LDFLAGS = $(GST_LIBS) -L$(top_builddir)/libs/gst/bytestream/ -lgstbytestream -noinst_HEADERS = mem.h diff --git a/tests/old/testsuite/bytestream/gstbstest.c b/tests/old/testsuite/bytestream/gstbstest.c index 48057031d..9a718c461 100644 --- a/tests/old/testsuite/bytestream/gstbstest.c +++ b/tests/old/testsuite/bytestream/gstbstest.c @@ -20,11 +20,14 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include <stdlib.h> #include <string.h> #include <gst/gst.h> -#include <gst/bytestream/bytestream.h> +#include <gst/gstbytestream.h> #define GST_TYPE_BSTEST (gst_bstest_get_type()) #define GST_BSTEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BSTEST,GstBsTest)) @@ -64,9 +67,11 @@ GType gst_bstest_get_type (void); GstElementDetails gst_bstest_details = { "ByteStreamTest", "Filter", + "LGPL", "Test for the GstByteStream code", VERSION, - "Erik Walthinsen <omega@temple-baptist.com>," "Wim Taymans <wim.taymans@chello.be>", + "Erik Walthinsen <omega@temple-baptist.com>," + "Wim Taymans <wim.taymans@chello.be>", "(C) 2001", }; @@ -160,22 +165,15 @@ gst_bstest_class_init (GstBsTestClass * klass) } -static GstPadLinkReturn -gst_bstest_negotiate_src (GstPad * pad, GstCaps ** caps, gpointer * data) +static GstCaps * +gst_bstest_getcaps (GstPad *pad, GstCaps *caps) { GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad)); + GstPad *otherpad; - /* thomas: I was trying to fix this old test, one of these two pads - * needs to be dropped according to the new api, which one ? */ - return gst_pad_proxy_link (pad, bstest->sinkpad, caps); -} - -static GstPadLinkReturn -gst_bstest_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data) -{ - GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad)); + otherpad = (pad == bstest->srcpad) ? bstest->sinkpad : bstest->srcpad; - return gst_pad_negotiate_proxy (pad, bstest->srcpad, caps); + return gst_pad_get_allowed_caps (otherpad); } static void @@ -183,11 +181,11 @@ gst_bstest_init (GstBsTest * bstest) { bstest->sinkpad = gst_pad_new ("sink", GST_PAD_SINK); gst_element_add_pad (GST_ELEMENT (bstest), bstest->sinkpad); - gst_pad_set_negotiate_function (bstest->sinkpad, gst_bstest_negotiate_sink); + gst_pad_set_getcaps_function (bstest->sinkpad, gst_bstest_getcaps); bstest->srcpad = gst_pad_new ("src", GST_PAD_SRC); gst_element_add_pad (GST_ELEMENT (bstest), bstest->srcpad); - gst_pad_set_negotiate_function (bstest->srcpad, gst_bstest_negotiate_src); + gst_pad_set_getcaps_function (bstest->srcpad, gst_bstest_getcaps); gst_element_set_loop_function (GST_ELEMENT (bstest), gst_bstest_loop); @@ -237,6 +235,7 @@ gst_bstest_loop (GstElement * element) do { guint size = 0; guint i = 0; + guint8 *ptr; while (i < bstest->num_patterns) { buf = NULL; @@ -244,7 +243,7 @@ gst_bstest_loop (GstElement * element) if (bstest->patterns[i][0] == 'r') { size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size); if (!bstest->silent) g_print ("bstest: ***** read %d bytes\n", size); - buf = gst_bytestream_read (bstest->bs, size); + gst_bytestream_read (bstest->bs, &buf, size); } else if (bstest->patterns[i][0] == 'f') { size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size); @@ -254,18 +253,18 @@ gst_bstest_loop (GstElement * element) else if (!strncmp (bstest->patterns[i], "pb", 2)) { size = gst_bstest_get_size (bstest, &bstest->patterns[i][2], size); if (!bstest->silent) g_print ("bstest: ***** peek bytes %d bytes\n", size); - gst_bytestream_peek_bytes (bstest->bs, size); + gst_bytestream_peek_bytes (bstest->bs, &ptr, size); } else if (bstest->patterns[i][0] == 'p') { size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size); if (!bstest->silent) g_print ("bstest: ***** peek %d bytes\n", size); - buf = gst_bytestream_peek (bstest->bs, size); + gst_bytestream_peek (bstest->bs, &buf, size); gst_buffer_unref (buf); buf = NULL; } if (buf) - gst_pad_push (bstest->srcpad, buf); + gst_pad_push (bstest->srcpad, GST_DATA (buf)); i++; } @@ -385,12 +384,6 @@ plugin_init (GModule * module, GstPlugin * plugin) { GstElementFactory *factory; - /* we need gstbytestream */ - if (!gst_library_load ("gstbytestream")) { - g_print ("can't load bytestream\n"); - return FALSE; - } - /* We need to create an ElementFactory for each element we provide. * This consists of the name of the element, the GType identifier, * and a pointer to the details structure at the top of the file. diff --git a/tests/old/testsuite/bytestream/mem.c b/tests/old/testsuite/bytestream/mem.c deleted file mode 100644 index d1c36cb5a..000000000 --- a/tests/old/testsuite/bytestream/mem.c +++ /dev/null @@ -1,23 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <fcntl.h> -#include <unistd.h> -#include <string.h> - -int vmsize() { - int pid,fd,size,i,mem; - char filename[17], buf[256], *ptr, *end; - - pid = getpid(); - snprintf(filename,17,"/proc/%d/stat",pid); - fd = open(filename,O_RDONLY); - size = read(fd,buf,240); - ptr = buf; - for (i=0;i<22;i++) - ptr = (char *)strchr(ptr,' ') + 1; - end = (char *)strchr(ptr,' '); - *end = 0; - sscanf(ptr,"%d",&mem); - close(fd); - return mem; -} diff --git a/tests/old/testsuite/bytestream/mem.h b/tests/old/testsuite/bytestream/mem.h deleted file mode 100644 index 28999db2c..000000000 --- a/tests/old/testsuite/bytestream/mem.h +++ /dev/null @@ -1 +0,0 @@ -int vmsize(); diff --git a/tests/old/testsuite/bytestream/test1.c b/tests/old/testsuite/bytestream/test1.c index 0000682a7..4545f9d7a 100644 --- a/tests/old/testsuite/bytestream/test1.c +++ b/tests/old/testsuite/bytestream/test1.c @@ -2,7 +2,6 @@ #include <stdlib.h> #include <gst/gst.h> -#include "mem.h" #define VM_THRES 1000 #define MAX_CONFIG_LINE 255 @@ -112,7 +111,7 @@ run_test (GstBin *pipeline, gint iters) gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); while (iters) { - gint newvm = vmsize(); + gint newvm = gst_alloc_trace_live_all (); gint percent; percent = (gint)((maxiters-iters+1)*100.0/maxiters); @@ -146,6 +145,7 @@ main (int argc, char *argv[]) GSList *walk; gint arg_walk; + gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE); gst_init (&argc, &argv); arg_walk = 1; diff --git a/tests/old/testsuite/caps/Makefile.am b/tests/old/testsuite/caps/Makefile.am index b93500388..02f82a3e4 100644 --- a/tests/old/testsuite/caps/Makefile.am +++ b/tests/old/testsuite/caps/Makefile.am @@ -1,27 +1,30 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -testprogs = intersection compatibility normalisation union string-conversions fixed intersect2 -# 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) +tests_pass = \ + intersection \ + compatibility \ + normalisation \ + union \ + string-conversions \ + fixed \ + intersect2 + +tests_fail = -check_PROGRAMS = $(testprogs) intersection_LDADD = $(GST_LIBS) -intersection_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +intersection_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) compatibility_LDADD = $(GST_LIBS) -compatibility_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +compatibility_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) normalisation_LDADD = $(GST_LIBS) -normalisation_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +normalisation_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) union_LDADD = $(GST_LIBS) -union_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +union_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) string_conversions_LDADD = $(GST_LIBS) -string_conversions_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +string_conversions_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) fixed_LDADD = $(GST_LIBS) -fixed_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +fixed_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) intersect2_LDADD = $(GST_LIBS) -intersect2_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +intersect2_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) diff --git a/tests/old/testsuite/cleanup/Makefile.am b/tests/old/testsuite/cleanup/Makefile.am index f59c69156..c3eafa7ed 100644 --- a/tests/old/testsuite/cleanup/Makefile.am +++ b/tests/old/testsuite/cleanup/Makefile.am @@ -1,20 +1,10 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -if BUILD_FAILING_TESTS -FAILING = cleanup3 cleanup4 -else -FAILING = -endif - -testprogs = cleanup1 cleanup2 $(FAILING) cleanup5 - -TESTS = $(testprogs) - -check_PROGRAMS = $(testprogs) +tests_pass = cleanup1 cleanup2 cleanup4 cleanup5 +tests_fail = cleanup3 # we have nothing but apps here, we can do this safely -cleanup1_LDADD = $(GST_LIBS) #-ldmallocth +cleanup1_LDADD = $(GST_LIBS) cleanup1_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS) cleanup2_LDADD = $(GST_LIBS) cleanup2_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS) diff --git a/tests/old/testsuite/clock/Makefile.am b/tests/old/testsuite/clock/Makefile.am index 21c3ce738..25b830ba6 100644 --- a/tests/old/testsuite/clock/Makefile.am +++ b/tests/old/testsuite/clock/Makefile.am @@ -1,12 +1,6 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -testprogs = clock1 clock2 +tests_pass = clock1 clock2 +tests_fail = -TESTS = $(testprogs) - -check_PROGRAMS = $(testprogs) - -LDADD = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) diff --git a/tests/old/testsuite/debug/Makefile.am b/tests/old/testsuite/debug/Makefile.am index 67513d757..dfcfd0271 100644 --- a/tests/old/testsuite/debug/Makefile.am +++ b/tests/old/testsuite/debug/Makefile.am @@ -1,10 +1,5 @@ -#testprogs = global output commandline category -testprogs = commandline category +include ../Rules -TESTS = $(testprogs) +tests_pass = commandline category global output +tests_fail = -check_PROGRAMS = $(testprogs) - -# we have nothing but apps here, we can do this safely -LIBS = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) diff --git a/tests/old/testsuite/dynparams/Makefile.am b/tests/old/testsuite/dynparams/Makefile.am index 69cbfe71e..119eeed26 100644 --- a/tests/old/testsuite/dynparams/Makefile.am +++ b/tests/old/testsuite/dynparams/Makefile.am @@ -1,10 +1,10 @@ -testprogs = dparamstest +include ../Rules -TESTS = $(testprogs) - -check_PROGRAMS = $(testprogs) +tests_pass = +tests_fail = dparamstest dparamstest_CFLAGS = $(GST_CFLAGS) -dparamstest_LDFLAGS = $(GST_LIBS) -L$(top_builddir)/libs/gst/control/ -lgstcontrol +dparamstest_LDFLAGS = $(GST_LIBS) +dparamstest_LDADD = $(top_builddir)/libs/gst/control/libgstcontrol-@GST_MAJORMINOR@.la dparamstest_SOURCES = dparamstest.c diff --git a/tests/old/testsuite/dynparams/dparamstest.c b/tests/old/testsuite/dynparams/dparamstest.c index 0e576f19f..6f1fbb222 100644 --- a/tests/old/testsuite/dynparams/dparamstest.c +++ b/tests/old/testsuite/dynparams/dparamstest.c @@ -21,6 +21,9 @@ #include <stdlib.h> #include <string.h> +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include <gst/gst.h> #include <gst/control/control.h> @@ -59,6 +62,7 @@ GType gst_dptest_get_type (void); GstElementDetails gst_dptest_details = { "DParamsTest", "Filter", + "LGPL", "Test for the GstDParam code", VERSION, "Steve Baker <stevebaker_org@yahoo.co.uk>", @@ -78,7 +82,7 @@ static void gst_dptest_set_property (GObject * object, guint prop_id, const GVal GParamSpec * pspec); static GstElementStateReturn gst_dptest_change_state (GstElement *element); -static void gst_dptest_chain (GstPad *pad, GstBuffer *buf); +static void gst_dptest_chain (GstPad *pad, GstData *buf); static GstElementClass *parent_class = NULL; @@ -178,10 +182,10 @@ gst_dptest_change_state (GstElement *element) } static void -gst_dptest_chain (GstPad *pad, GstBuffer *buf) +gst_dptest_chain (GstPad *pad, GstData *data) { GstDpTest *dptest; - gint i=0, frame_countdown; + gint frame_countdown; dptest = GST_DPTEST(gst_pad_get_parent (pad)); g_assert(dptest); @@ -189,7 +193,7 @@ gst_dptest_chain (GstPad *pad, GstBuffer *buf) /* we're using a made up buffer size of 64 and a timestamp of zero */ frame_countdown = GST_DPMAN_PREPROCESS(dptest->dpman, 64, 0LL); - while(GST_DPMAN_PROCESS_COUNTDOWN(dptest->dpman, frame_countdown, i)); + while(GST_DPMAN_PROCESS(dptest->dpman, frame_countdown)); g_print("dp chain\n"); } diff --git a/tests/old/testsuite/elements/Makefile.am b/tests/old/testsuite/elements/Makefile.am index af78be061..232f10e46 100644 --- a/tests/old/testsuite/elements/Makefile.am +++ b/tests/old/testsuite/elements/Makefile.am @@ -1,18 +1,7 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -if BUILD_FAILING_TESTS -tests_failing = fake -else -tests_failing = -endif -tests_working = name tee property +tests_pass = name tee property fake +tests_fail = -TESTS = $(tests_working) - -check_PROGRAMS = $(tests_failing) $(tests_working) - -EXTRA_DIST = property.h -LDADD = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) +noinst_HEADERS = property.h diff --git a/tests/old/testsuite/indexers/Makefile.am b/tests/old/testsuite/indexers/Makefile.am index e1c8d6e36..76730104e 100644 --- a/tests/old/testsuite/indexers/Makefile.am +++ b/tests/old/testsuite/indexers/Makefile.am @@ -1,11 +1,6 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -testprogs = cache1 indexdump +tests_pass = cache1 indexdump +tests_fail = -TESTS = $(testprogs) -check_PROGRAMS = $(testprogs) - -LDADD = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) diff --git a/tests/old/testsuite/parse/Makefile.am b/tests/old/testsuite/parse/Makefile.am index 0c431f77b..3edad6d06 100644 --- a/tests/old/testsuite/parse/Makefile.am +++ b/tests/old/testsuite/parse/Makefile.am @@ -1,12 +1,8 @@ +include ../Rules -check_PROGRAMS = parse1 parse2 - -# parse1 is broken -TESTS = parse2 +tests_pass = parse2 +tests_fail = parse1 parse1_SOURCES = parse1.c parse2_SOURCES = parse2.c -# we have nothing but apps here, we can do this safely -LIBS = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) diff --git a/tests/old/testsuite/parse/parse1.c b/tests/old/testsuite/parse/parse1.c index 4598e9735..debf5ff0d 100644 --- a/tests/old/testsuite/parse/parse1.c +++ b/tests/old/testsuite/parse/parse1.c @@ -21,6 +21,7 @@ #include <gst/gst.h> #include <string.h> +#include <unistd.h> /* variables used by the TEST_* macros */ static gint test = 0; @@ -58,6 +59,7 @@ static gchar *s; g_print ("TEST %2d line %3d COMPLETE\n", test, __LINE__); \ }G_STMT_END #define TEST_RUN G_STMT_START{ \ + alarm(10); \ g_print ("TEST %2d line %3d RUN\n", test, __LINE__); \ if (gst_element_set_state (cur, GST_STATE_PLAYING) == GST_STATE_FAILURE) { \ g_print ("TEST %2d line %3d FAILED : pipeline could not be set to state PLAYING\n", test, __LINE__); \ @@ -70,6 +72,7 @@ static gchar *s; return -test; \ } \ g_print ("TEST %2d line %3d STOPPED : %u iterations\n", test, __LINE__, iterations); \ + alarm(0); \ }G_STMT_END #define PIPELINE1 "fakesrc" #define PIPELINE2 "fakesrc name=donald num-buffers= 27 silent =TruE sizetype = 3 eos = yesyo data= Subbuffer\\ data" diff --git a/tests/old/testsuite/plugin/Makefile.am b/tests/old/testsuite/plugin/Makefile.am index 4ef486d3a..a8d1887bb 100644 --- a/tests/old/testsuite/plugin/Makefile.am +++ b/tests/old/testsuite/plugin/Makefile.am @@ -1,13 +1,10 @@ -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(top_builddir) GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml +include ../Rules -plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ plugin_LTLIBRARIES = libtestplugin.la libtestplugin2.la -# FIXME : tests need fixing -testprogs = static dynamic linked loading registry static2 +tests_pass = static dynamic static2 linked loading registry +tests_fail = -AM_CFLAGS = $(GST_CFLAGS) -LIBS = $(GST_LIBS) libtestplugin_la_SOURCES = testplugin.c libtestplugin_la_CFLAGS = $(GST_CFLAGS) @@ -20,10 +17,3 @@ linked_LIBS = libtestplugin.la libtestplugin2.la static_SOURCES = static.c testplugin_s.c testplugin2_s.c -check_PROGRAMS = $(testprogs) - -TESTS = $(top_builddir)/tools/gst-register $(testprogs) - -# override to _not_ install the test plugins -install-pluginLTLIBRARIES: - diff --git a/tests/old/testsuite/refcounting/Makefile.am b/tests/old/testsuite/refcounting/Makefile.am index b7fbe2236..41365ece2 100644 --- a/tests/old/testsuite/refcounting/Makefile.am +++ b/tests/old/testsuite/refcounting/Makefile.am @@ -1,29 +1,15 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -if BUILD_FAILING_TESTS -tests_failing = element bin element_pad pad -else -tests_failing = -endif -tests_working = mainloop sched +tests_pass = bin element mainloop pad +tests_fail = element_pad sched element_SOURCES = element.c mem.c pad_SOURCES = pad.c mem.c - element_pad_SOURCES = element_pad.c mem.c bin_SOURCES = bin.c mem.c -TESTS = $(tests_working) - -check_PROGRAMS = $(TESTS) -noinst_PROGRAMS = $(tests_failing) - EXTRA_DIST = thread.c object.c noinst_HEADERS = mem.h -# we have nothing but apps here, we can do this safely -LIBS = $(GST_LIBS) -AM_CFLAGS = $(GLIB_CFLAGS) $(XML_CFLAGS) $(GST_CFLAGS) diff --git a/tests/old/testsuite/refcounting/bin.c b/tests/old/testsuite/refcounting/bin.c index a2811fac5..81c867180 100644 --- a/tests/old/testsuite/refcounting/bin.c +++ b/tests/old/testsuite/refcounting/bin.c @@ -1,8 +1,7 @@ #include <gst/gst.h> -#define ITERS 100000 +#define ITERS 100 #include <stdlib.h> -#include "mem.h" static GstElement* create_bin (void) @@ -73,12 +72,16 @@ add_remove_test2 (void) g_assert (!GST_OBJECT_DESTROYED (element)); gst_object_unref (GST_OBJECT (element)); +#if 0 g_assert (GST_OBJECT_DESTROYED (element)); gst_object_unref (GST_OBJECT (element)); +#endif gst_object_unref (GST_OBJECT (bin)); } +#if 0 +/* This code is bogus */ static void add_remove_test3 (void) { @@ -97,7 +100,10 @@ add_remove_test3 (void) gst_object_unref (GST_OBJECT (bin)); } +#endif +#if 0 +/* This code is bogus */ static void add_remove_test4 (void) { @@ -123,14 +129,17 @@ add_remove_test4 (void) gst_object_unref (GST_OBJECT (bin)); } +#endif int main (int argc, gchar *argv[]) { GstElement *bin; - long usage1; + int usage1; gint i, iters; + gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE); + gst_init (&argc, &argv); if (argc == 2) @@ -138,18 +147,21 @@ main (int argc, gchar *argv[]) else iters = ITERS; + g_print ("starting test\n"); - usage1 = vmsize(); + + usage1 = gst_alloc_trace_live_all (); + //gst_alloc_trace_print_all (); bin = gst_bin_new ("somebin"); gst_object_unref (GST_OBJECT (bin)); - g_print ("create/unref new bin %ld\n", vmsize()-usage1); + g_print ("create/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = gst_bin_new ("somebin"); gst_object_unref (GST_OBJECT (bin)); } - g_print ("create/unref %d bins %ld\n", iters, vmsize()-usage1); + g_print ("create/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1); bin = gst_bin_new ("somebin"); g_assert (GST_OBJECT_FLOATING (bin)); @@ -157,7 +169,7 @@ main (int argc, gchar *argv[]) gst_object_sink (GST_OBJECT (bin)); g_assert (!GST_OBJECT_FLOATING (bin)); gst_object_unref (GST_OBJECT (bin)); - g_print ("create/ref/sink/unref new bin %ld\n", vmsize()-usage1); + g_print ("create/ref/sink/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { @@ -166,27 +178,31 @@ main (int argc, gchar *argv[]) gst_object_sink (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); } - g_print ("create/ref/sink/unref %d bins %ld\n", iters, vmsize()-usage1); + g_print ("create/ref/sink/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1); bin = gst_bin_new ("somebin"); g_assert (!GST_OBJECT_DESTROYED (bin)); gst_object_unref (GST_OBJECT (bin)); +#if 0 g_assert (GST_OBJECT_DESTROYED (bin)); gst_object_unref (GST_OBJECT (bin)); - g_print ("create/destroy/unref new bin %ld\n", vmsize()-usage1); +#endif + g_print ("create/destroy/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = gst_bin_new ("somebin"); gst_object_unref (GST_OBJECT (bin)); +#if 0 gst_object_unref (GST_OBJECT (bin)); +#endif } - g_print ("create/destroy/unref %d bin %ld\n", iters, vmsize()-usage1); + g_print ("create/destroy/unref %d bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); bin = gst_bin_new ("somebin"); gst_object_ref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); - g_print ("create/ref/unref/unref new bin %ld\n", vmsize()-usage1); + g_print ("create/ref/unref/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = gst_bin_new ("somebin"); @@ -194,23 +210,27 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); } - g_print ("create/ref/unref/unref %d bin %ld\n", iters, vmsize()-usage1); + g_print ("create/ref/unref/unref %d bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); bin = gst_bin_new ("somebin"); gst_object_ref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); +#if 0 gst_object_unref (GST_OBJECT (bin)); - g_print ("craete/ref/destroy/unref/unref new bin %ld\n", vmsize()-usage1); +#endif + g_print ("craete/ref/destroy/unref/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = gst_bin_new ("somebin"); gst_object_ref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); +#if 0 gst_object_unref (GST_OBJECT (bin)); +#endif } - g_print ("craete/ref/destroy/unref/unref %d bins %ld\n", iters, vmsize()-usage1); + g_print ("craete/ref/destroy/unref/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = gst_bin_new ("somebin"); @@ -219,50 +239,58 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (bin)); gst_element_set_name (bin, "testing123"); gst_object_unref (GST_OBJECT (bin)); +#if 0 gst_object_unref (GST_OBJECT (bin)); +#endif } - g_print ("craete/ref/destroy/unref/unref %d bins with name %ld\n", iters, vmsize()-usage1); + g_print ("craete/ref/destroy/unref/unref %d bins with name %d\n", iters, gst_alloc_trace_live_all ()-usage1); bin = gst_bin_new ("somebin"); for (i=0; i<iters;i++) { gst_element_set_name (bin, "testing"); } gst_object_unref (GST_OBJECT (bin)); - g_print ("set name %d times %ld\n", iters, vmsize()-usage1); + g_print ("set name %d times %d\n", iters, gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = create_bin(); gst_object_unref (GST_OBJECT (bin)); } - g_print ("create/unref %d bin with children %ld\n", iters, vmsize()-usage1); + g_print ("create/unref %d bin with children %d\n", iters, gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters/2;i++) { bin = create_bin_ghostpads(); gst_object_unref (GST_OBJECT (bin)); } - g_print ("create/unref %d bin with children and ghostpads %ld\n", iters/2, vmsize()-usage1); + g_print ("create/unref %d bin with children and ghostpads %d\n", iters/2, gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { add_remove_test1(); } - g_print ("add/remove test1 %d in bin %ld\n", iters, vmsize()-usage1); + g_print ("add/remove test1 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { add_remove_test2(); } - g_print ("add/remove test2 %d in bin %ld\n", iters, vmsize()-usage1); + g_print ("add/remove test2 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#if 0 for (i=0; i<iters;i++) { add_remove_test3(); } - g_print ("add/destroy/remove test3 %d in bin %ld\n", iters, vmsize()-usage1); + g_print ("add/destroy/remove test3 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { add_remove_test4(); } - g_print ("add/destroy/remove test4 %d in bin %ld\n", iters, vmsize()-usage1); + g_print ("add/destroy/remove test4 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#endif + + g_print ("leaked: %d\n", gst_alloc_trace_live_all ()-usage1); - g_print ("leaked: %ld\n", vmsize()-usage1); + //gst_alloc_trace_print_all (); - return (vmsize()-usage1 ? -1 : 0); + return (gst_alloc_trace_live_all ()-usage1 ? -1 : 0); } diff --git a/tests/old/testsuite/refcounting/element.c b/tests/old/testsuite/refcounting/element.c index f8f299eda..78d36106e 100644 --- a/tests/old/testsuite/refcounting/element.c +++ b/tests/old/testsuite/refcounting/element.c @@ -1,14 +1,13 @@ #include <gst/gst.h> -#define ITERS 10000 +#define ITERS 100 #include <stdlib.h> -#include "mem.h" int main (int argc, gchar *argv[]) { GstElement *element; - long usage1; + int usage1; gint i, iters; gst_init (&argc, &argv); @@ -19,17 +18,19 @@ main (int argc, gchar *argv[]) iters = ITERS; g_print ("starting test\n"); - usage1 = vmsize(); + + usage1 = gst_alloc_trace_live_all (); + //gst_alloc_trace_print_all (); element = gst_element_factory_make ("fakesrc", NULL); gst_object_unref (GST_OBJECT (element)); - g_print ("create/unref new element %ld\n", vmsize()-usage1); + g_print ("create/unref new element %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { element = gst_element_factory_make ("fakesrc", NULL); gst_object_unref (GST_OBJECT (element)); } - g_print ("create/unref %d elements %ld\n", iters, vmsize()-usage1); + g_print ("create/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1); element = gst_element_factory_make ("fakesrc", NULL); g_assert (GST_OBJECT_FLOATING (element)); @@ -37,7 +38,7 @@ main (int argc, gchar *argv[]) gst_object_sink (GST_OBJECT (element)); g_assert (!GST_OBJECT_FLOATING (element)); gst_object_unref (GST_OBJECT (element)); - g_print ("create/ref/sink/unref new element %ld\n", vmsize()-usage1); + g_print ("create/ref/sink/unref new element %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { @@ -46,27 +47,31 @@ main (int argc, gchar *argv[]) gst_object_sink (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); } - g_print ("create/ref/sink/unref %d elements %ld\n", iters, vmsize()-usage1); + g_print ("create/ref/sink/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#if 0 element = gst_element_factory_make ("fakesrc", NULL); g_assert (!GST_OBJECT_DESTROYED (element)); gst_object_unref (GST_OBJECT (element)); g_assert (GST_OBJECT_DESTROYED (element)); gst_object_unref (GST_OBJECT (element)); - g_print ("create/destroy/unref new element %ld\n", vmsize()-usage1); + g_print ("create/destroy/unref new element %d\n", gst_alloc_trace_live_all ()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { element = gst_element_factory_make ("fakesrc", NULL); gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); } - g_print ("create/destroy/unref %d element %ld\n", iters, vmsize()-usage1); + g_print ("create/destroy/unref %d element %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#endif element = gst_element_factory_make ("fakesrc", NULL); gst_object_ref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); - g_print ("create/ref/unref/unref new element %ld\n", vmsize()-usage1); + g_print ("create/ref/unref/unref new element %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { element = gst_element_factory_make ("fakesrc", NULL); @@ -74,15 +79,18 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); } - g_print ("create/ref/unref/unref %d element %ld\n", iters, vmsize()-usage1); + g_print ("create/ref/unref/unref %d element %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#if 0 element = gst_element_factory_make ("fakesrc", NULL); gst_object_ref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); - g_print ("craete/ref/destroy/unref/unref new element %ld\n", vmsize()-usage1); + g_print ("craete/ref/destroy/unref/unref new element %d\n", gst_alloc_trace_live_all ()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { element = gst_element_factory_make ("fakesrc", NULL); gst_object_ref (GST_OBJECT (element)); @@ -90,8 +98,10 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); } - g_print ("craete/ref/destroy/unref/unref %d elements %ld\n", iters, vmsize()-usage1); + g_print ("craete/ref/destroy/unref/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { element = gst_element_factory_make ("fakesrc", NULL); gst_object_ref (GST_OBJECT (element)); @@ -101,16 +111,17 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); } - g_print ("craete/ref/destroy/unref/unref %d elements with name %ld\n", iters, vmsize()-usage1); + g_print ("craete/ref/destroy/unref/unref %d elements with name %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#endif element = gst_element_factory_make ("fakesrc", NULL); for (i=0; i<iters;i++) { gst_element_set_name (element, "testing"); } gst_object_unref (GST_OBJECT (element)); - g_print ("set name %d times %ld\n", iters, vmsize()-usage1); + g_print ("set name %d times %d\n", iters, gst_alloc_trace_live_all ()-usage1); - g_print ("leaked: %ld\n", vmsize()-usage1); + g_print ("leaked: %d\n", gst_alloc_trace_live_all ()-usage1); - return (vmsize()-usage1 ? -1 : 0); + return (gst_alloc_trace_live_all ()-usage1 ? -1 : 0); } diff --git a/tests/old/testsuite/refcounting/element_pad.c b/tests/old/testsuite/refcounting/element_pad.c index cbcf22ecc..f0cf572e0 100644 --- a/tests/old/testsuite/refcounting/element_pad.c +++ b/tests/old/testsuite/refcounting/element_pad.c @@ -1,6 +1,6 @@ #include <gst/gst.h> -#define ITERS 100000 +#define ITERS 100 #include <stdlib.h> #include "mem.h" diff --git a/tests/old/testsuite/refcounting/pad.c b/tests/old/testsuite/refcounting/pad.c index 1aa259bb2..a353c5dd7 100644 --- a/tests/old/testsuite/refcounting/pad.c +++ b/tests/old/testsuite/refcounting/pad.c @@ -1,6 +1,6 @@ #include <gst/gst.h> -#define ITERS 100000 +#define ITERS 100 #include <stdlib.h> #include "mem.h" @@ -12,13 +12,19 @@ main (int argc, gchar *argv[]) long usage1; gint i, iters; + gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE); + gst_init (&argc, &argv); + g_mem_profile (); + if (argc == 2) iters = atoi (argv[1]); else iters = ITERS; + //gst_alloc_trace_print_all (); + g_print ("starting pad test\n"); usage1 = vmsize(); @@ -48,19 +54,23 @@ main (int argc, gchar *argv[]) } g_print ("create/ref/sink/unref %d pads %ld\n", iters, vmsize()-usage1); +#if 0 pad = gst_pad_new ("padname", GST_PAD_SINK); g_assert (!GST_OBJECT_DESTROYED (pad)); gst_object_unref (GST_OBJECT (pad)); g_assert (GST_OBJECT_DESTROYED (pad)); gst_object_unref (GST_OBJECT (pad)); g_print ("create/destroy/unref pad %ld\n", vmsize()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { pad = gst_pad_new ("padname", GST_PAD_SINK); gst_object_unref (GST_OBJECT (pad)); gst_object_unref (GST_OBJECT (pad)); } g_print ("create/destroy/unref %d pads %ld\n", iters, vmsize()-usage1); +#endif pad = gst_pad_new ("padname", GST_PAD_SINK); gst_object_ref (GST_OBJECT (pad)); @@ -80,18 +90,23 @@ main (int argc, gchar *argv[]) gst_object_ref (GST_OBJECT (pad)); gst_object_unref (GST_OBJECT (pad)); gst_object_unref (GST_OBJECT (pad)); +#if 0 gst_object_unref (GST_OBJECT (pad)); +#endif g_print ("create/ref/destroy/unref/unref pad %ld\n", vmsize()-usage1); +#if 0 for (i=0; i<iters;i++) { pad = gst_pad_new ("padname", GST_PAD_SINK); gst_object_ref (GST_OBJECT (pad)); gst_object_unref (GST_OBJECT (pad)); gst_object_unref (GST_OBJECT (pad)); - gst_object_unref (GST_OBJECT (pad)); + //gst_object_unref (GST_OBJECT (pad)); } g_print ("create/ref/destroy/unref/unref %d pads %ld\n", iters, vmsize()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { pad = gst_pad_new ("padname", GST_PAD_SINK); gst_object_ref (GST_OBJECT (pad)); @@ -102,6 +117,7 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (pad)); } g_print ("create/ref/destroy/unref/unref %d pads %ld with name\n", iters, vmsize()-usage1); +#endif pad = gst_pad_new ("padname", GST_PAD_SINK); for (i=0; i<iters;i++) { @@ -125,5 +141,7 @@ main (int argc, gchar *argv[]) g_print ("leaked: %ld\n", vmsize()-usage1); + //gst_alloc_trace_print_all (); + return vmsize()-usage1; } diff --git a/tests/old/testsuite/refcounting/sched.c b/tests/old/testsuite/refcounting/sched.c index 3c057e498..7294beecd 100644 --- a/tests/old/testsuite/refcounting/sched.c +++ b/tests/old/testsuite/refcounting/sched.c @@ -11,7 +11,7 @@ make_and_check_element (gchar *type, gchar *name) if (element == NULL) { g_warning ("Could not run test, because element type \"%s\" is not installed. Please retry when it is. Assuming it works for now...", type); - exit (0); + exit (1); } return element; diff --git a/tests/old/testsuite/states/Makefile.am b/tests/old/testsuite/states/Makefile.am index 8f8ee1034..2c7020fa6 100644 --- a/tests/old/testsuite/states/Makefile.am +++ b/tests/old/testsuite/states/Makefile.am @@ -1,11 +1,8 @@ -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 +include ../Rules -testprogs = locked +tests_pass = locked +tests_fail = -TESTS = $(testprogs) - -check_PROGRAMS = $(testprogs) locked_LDADD = $(GST_LIBS) locked_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) diff --git a/tests/old/testsuite/threads/Makefile.am b/tests/old/testsuite/threads/Makefile.am index 0f013b9df..203724bed 100644 --- a/tests/old/testsuite/threads/Makefile.am +++ b/tests/old/testsuite/threads/Makefile.am @@ -1,17 +1,8 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -testprogs = thread1 thread2 thread5 -testsfailing = threadb threadc threadd threade threadf thread4 queue thread3 +tests_pass = thread1 thread2 thread3 thread4 threadf +tests_fail = thread5 threadb threadc threadd threade queue -TESTS = $(testprogs) - -check_PROGRAMS = $(testprogs) - -noinst_PROGRAMS = $(testsfailing) - -LDADD = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) queue_SOURCES = queue.c queue_CFLAGS = $(AM_CFLAGS) diff --git a/tests/old/testsuite/threads/thread.c b/tests/old/testsuite/threads/thread.c index eece4d000..2054986f2 100644 --- a/tests/old/testsuite/threads/thread.c +++ b/tests/old/testsuite/threads/thread.c @@ -35,7 +35,7 @@ construct_pipeline (GstElement *pipeline) gst_bin_add_many (GST_BIN (thread), identity, sink, NULL); g_object_set (G_OBJECT (src), "num_buffers", 5, NULL); - g_object_set (sink, "signal-handoff", TRUE, NULL); + g_object_set (sink, "signal-handoffs", TRUE, NULL); } void @@ -106,7 +106,7 @@ main (gint argc, gchar *argv[]) gst_element_set_state (pipeline, GST_STATE_NULL); } if (TESTNUM == 5) { - /* I don't this test is supposed to work */ + /* I don't think this test is supposed to work */ GstElement *sink; sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink"); diff --git a/tests/old/testsuite/threads/threadd.c b/tests/old/testsuite/threads/threadd.c index 13147fa48..e9ff75360 100644 --- a/tests/old/testsuite/threads/threadd.c +++ b/tests/old/testsuite/threads/threadd.c @@ -1,4 +1,5 @@ #include <gst/gst.h> +#include <unistd.h> /* threadc.c * this tests if we can make a GstThread, with enough cothreads to stress it @@ -59,6 +60,8 @@ main (gint argc, gchar *argv[]) gulong id; GstElement *thread; + alarm(10); + gst_init (&argc, &argv); for (i = 0; i < runs; ++i) diff --git a/tests/old/testsuite/threads/threade.c b/tests/old/testsuite/threads/threade.c index 79e621321..98b15dd3c 100644 --- a/tests/old/testsuite/threads/threade.c +++ b/tests/old/testsuite/threads/threade.c @@ -1,4 +1,5 @@ #include <gst/gst.h> +#include <unistd.h> /* threadc.c * this tests if we can make a GstBin and iterate it inside a GThread @@ -54,6 +55,8 @@ main (gint argc, gchar *argv[]) int i; GstElement *pipeline; + alarm(10); + g_thread_init (NULL); gst_init (&argc, &argv); diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 3dbaa23de..0e181893d 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -1,3 +1,6 @@ +include Rules + + if GST_DISABLE_PARSE GST_PARSE_DIRS = else @@ -10,35 +13,18 @@ else GST_DEBUG_DIRS = debug endif -# FIXME : threads bytestream -SUBDIRS = caps plugin elements clock refcounting threads indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) ## cleanup dynparams - -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 -inspectcheck = gst-inspect-check -else -testprogs = -inspectcheck = -endif - -# 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) +SUBDIRS = bytestream cleanup dynparams \ + caps plugin elements clock refcounting threads \ + indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) -check_PROGRAMS = $(testprogs) +DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \ + plugin refcounting threads parse debug -# we have nothing but apps here, we can do this safely -LIBS = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) +tests_pass = test_gst_init +tests_fail = # we makes them, we gots to clean them -CLEANFILES = test-registry.xml - -DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements indexers \ - plugin refcounting threads parse debug +CLEANFILES += test-registry.xml EXTRA_DIST = gst-inspect-check + diff --git a/testsuite/Rules b/testsuite/Rules new file mode 100644 index 000000000..dbde51105 --- /dev/null +++ b/testsuite/Rules @@ -0,0 +1,24 @@ + +TESTS_ENVIRONMENT=\ + G_DEBUG=fatal_warnings \ + GST_PLUGIN_PATH=$(top_builddir) \ + GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml + + +plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ + +check_PROGRAMS = $(tests_pass) $(tests_fail) + +TESTS = $(top_builddir)/tools/gst-register $(tests_pass) $(tests_fail) +XFAIL_TESTS = $(tests_fail) + +AM_CFLAGS = $(GST_CFLAGS) +LIBS = $(GST_LIBS) + +# override to _not_ install the test plugins +install-pluginLTLIBRARIES: + +# This rule is here so make distcheck works on machines where core +# dumps have PIDs appended +CLEANFILES = core.* + diff --git a/testsuite/bytestream/Makefile.am b/testsuite/bytestream/Makefile.am index 696ad9822..317e3d46b 100644 --- a/testsuite/bytestream/Makefile.am +++ b/testsuite/bytestream/Makefile.am @@ -1,11 +1,8 @@ -## filterdir = $(libdir)/gst +include ../Rules -testprogs = test1 +tests_pass = +tests_fail = test1 -check_PROGRAMS = $(testprogs) +test1_SOURCES = test1.c gstbstest.c -test1_SOURCES = test1.c gstbstest.c mem.c -test1_CFLAGS = $(GST_CFLAGS) -test1_LDFLAGS = $(GST_LIBS) -L$(top_builddir)/libs/gst/bytestream/ -lgstbytestream -noinst_HEADERS = mem.h diff --git a/testsuite/bytestream/gstbstest.c b/testsuite/bytestream/gstbstest.c index 48057031d..9a718c461 100644 --- a/testsuite/bytestream/gstbstest.c +++ b/testsuite/bytestream/gstbstest.c @@ -20,11 +20,14 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include <stdlib.h> #include <string.h> #include <gst/gst.h> -#include <gst/bytestream/bytestream.h> +#include <gst/gstbytestream.h> #define GST_TYPE_BSTEST (gst_bstest_get_type()) #define GST_BSTEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BSTEST,GstBsTest)) @@ -64,9 +67,11 @@ GType gst_bstest_get_type (void); GstElementDetails gst_bstest_details = { "ByteStreamTest", "Filter", + "LGPL", "Test for the GstByteStream code", VERSION, - "Erik Walthinsen <omega@temple-baptist.com>," "Wim Taymans <wim.taymans@chello.be>", + "Erik Walthinsen <omega@temple-baptist.com>," + "Wim Taymans <wim.taymans@chello.be>", "(C) 2001", }; @@ -160,22 +165,15 @@ gst_bstest_class_init (GstBsTestClass * klass) } -static GstPadLinkReturn -gst_bstest_negotiate_src (GstPad * pad, GstCaps ** caps, gpointer * data) +static GstCaps * +gst_bstest_getcaps (GstPad *pad, GstCaps *caps) { GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad)); + GstPad *otherpad; - /* thomas: I was trying to fix this old test, one of these two pads - * needs to be dropped according to the new api, which one ? */ - return gst_pad_proxy_link (pad, bstest->sinkpad, caps); -} - -static GstPadLinkReturn -gst_bstest_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data) -{ - GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad)); + otherpad = (pad == bstest->srcpad) ? bstest->sinkpad : bstest->srcpad; - return gst_pad_negotiate_proxy (pad, bstest->srcpad, caps); + return gst_pad_get_allowed_caps (otherpad); } static void @@ -183,11 +181,11 @@ gst_bstest_init (GstBsTest * bstest) { bstest->sinkpad = gst_pad_new ("sink", GST_PAD_SINK); gst_element_add_pad (GST_ELEMENT (bstest), bstest->sinkpad); - gst_pad_set_negotiate_function (bstest->sinkpad, gst_bstest_negotiate_sink); + gst_pad_set_getcaps_function (bstest->sinkpad, gst_bstest_getcaps); bstest->srcpad = gst_pad_new ("src", GST_PAD_SRC); gst_element_add_pad (GST_ELEMENT (bstest), bstest->srcpad); - gst_pad_set_negotiate_function (bstest->srcpad, gst_bstest_negotiate_src); + gst_pad_set_getcaps_function (bstest->srcpad, gst_bstest_getcaps); gst_element_set_loop_function (GST_ELEMENT (bstest), gst_bstest_loop); @@ -237,6 +235,7 @@ gst_bstest_loop (GstElement * element) do { guint size = 0; guint i = 0; + guint8 *ptr; while (i < bstest->num_patterns) { buf = NULL; @@ -244,7 +243,7 @@ gst_bstest_loop (GstElement * element) if (bstest->patterns[i][0] == 'r') { size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size); if (!bstest->silent) g_print ("bstest: ***** read %d bytes\n", size); - buf = gst_bytestream_read (bstest->bs, size); + gst_bytestream_read (bstest->bs, &buf, size); } else if (bstest->patterns[i][0] == 'f') { size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size); @@ -254,18 +253,18 @@ gst_bstest_loop (GstElement * element) else if (!strncmp (bstest->patterns[i], "pb", 2)) { size = gst_bstest_get_size (bstest, &bstest->patterns[i][2], size); if (!bstest->silent) g_print ("bstest: ***** peek bytes %d bytes\n", size); - gst_bytestream_peek_bytes (bstest->bs, size); + gst_bytestream_peek_bytes (bstest->bs, &ptr, size); } else if (bstest->patterns[i][0] == 'p') { size = gst_bstest_get_size (bstest, &bstest->patterns[i][1], size); if (!bstest->silent) g_print ("bstest: ***** peek %d bytes\n", size); - buf = gst_bytestream_peek (bstest->bs, size); + gst_bytestream_peek (bstest->bs, &buf, size); gst_buffer_unref (buf); buf = NULL; } if (buf) - gst_pad_push (bstest->srcpad, buf); + gst_pad_push (bstest->srcpad, GST_DATA (buf)); i++; } @@ -385,12 +384,6 @@ plugin_init (GModule * module, GstPlugin * plugin) { GstElementFactory *factory; - /* we need gstbytestream */ - if (!gst_library_load ("gstbytestream")) { - g_print ("can't load bytestream\n"); - return FALSE; - } - /* We need to create an ElementFactory for each element we provide. * This consists of the name of the element, the GType identifier, * and a pointer to the details structure at the top of the file. diff --git a/testsuite/bytestream/mem.c b/testsuite/bytestream/mem.c deleted file mode 100644 index d1c36cb5a..000000000 --- a/testsuite/bytestream/mem.c +++ /dev/null @@ -1,23 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <fcntl.h> -#include <unistd.h> -#include <string.h> - -int vmsize() { - int pid,fd,size,i,mem; - char filename[17], buf[256], *ptr, *end; - - pid = getpid(); - snprintf(filename,17,"/proc/%d/stat",pid); - fd = open(filename,O_RDONLY); - size = read(fd,buf,240); - ptr = buf; - for (i=0;i<22;i++) - ptr = (char *)strchr(ptr,' ') + 1; - end = (char *)strchr(ptr,' '); - *end = 0; - sscanf(ptr,"%d",&mem); - close(fd); - return mem; -} diff --git a/testsuite/bytestream/mem.h b/testsuite/bytestream/mem.h deleted file mode 100644 index 28999db2c..000000000 --- a/testsuite/bytestream/mem.h +++ /dev/null @@ -1 +0,0 @@ -int vmsize(); diff --git a/testsuite/bytestream/test1.c b/testsuite/bytestream/test1.c index 0000682a7..4545f9d7a 100644 --- a/testsuite/bytestream/test1.c +++ b/testsuite/bytestream/test1.c @@ -2,7 +2,6 @@ #include <stdlib.h> #include <gst/gst.h> -#include "mem.h" #define VM_THRES 1000 #define MAX_CONFIG_LINE 255 @@ -112,7 +111,7 @@ run_test (GstBin *pipeline, gint iters) gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); while (iters) { - gint newvm = vmsize(); + gint newvm = gst_alloc_trace_live_all (); gint percent; percent = (gint)((maxiters-iters+1)*100.0/maxiters); @@ -146,6 +145,7 @@ main (int argc, char *argv[]) GSList *walk; gint arg_walk; + gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE); gst_init (&argc, &argv); arg_walk = 1; diff --git a/testsuite/caps/Makefile.am b/testsuite/caps/Makefile.am index b93500388..02f82a3e4 100644 --- a/testsuite/caps/Makefile.am +++ b/testsuite/caps/Makefile.am @@ -1,27 +1,30 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -testprogs = intersection compatibility normalisation union string-conversions fixed intersect2 -# 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) +tests_pass = \ + intersection \ + compatibility \ + normalisation \ + union \ + string-conversions \ + fixed \ + intersect2 + +tests_fail = -check_PROGRAMS = $(testprogs) intersection_LDADD = $(GST_LIBS) -intersection_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +intersection_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) compatibility_LDADD = $(GST_LIBS) -compatibility_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +compatibility_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) normalisation_LDADD = $(GST_LIBS) -normalisation_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +normalisation_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) union_LDADD = $(GST_LIBS) -union_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +union_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) string_conversions_LDADD = $(GST_LIBS) -string_conversions_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +string_conversions_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) fixed_LDADD = $(GST_LIBS) -fixed_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +fixed_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) intersect2_LDADD = $(GST_LIBS) -intersect2_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) +intersect2_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) diff --git a/testsuite/cleanup/Makefile.am b/testsuite/cleanup/Makefile.am index f59c69156..c3eafa7ed 100644 --- a/testsuite/cleanup/Makefile.am +++ b/testsuite/cleanup/Makefile.am @@ -1,20 +1,10 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -if BUILD_FAILING_TESTS -FAILING = cleanup3 cleanup4 -else -FAILING = -endif - -testprogs = cleanup1 cleanup2 $(FAILING) cleanup5 - -TESTS = $(testprogs) - -check_PROGRAMS = $(testprogs) +tests_pass = cleanup1 cleanup2 cleanup4 cleanup5 +tests_fail = cleanup3 # we have nothing but apps here, we can do this safely -cleanup1_LDADD = $(GST_LIBS) #-ldmallocth +cleanup1_LDADD = $(GST_LIBS) cleanup1_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS) cleanup2_LDADD = $(GST_LIBS) cleanup2_CFLAGS = $(GST_CFLAGS) $(XML_CFLAGS) $(GLIB_CFLAGS) diff --git a/testsuite/clock/Makefile.am b/testsuite/clock/Makefile.am index 21c3ce738..25b830ba6 100644 --- a/testsuite/clock/Makefile.am +++ b/testsuite/clock/Makefile.am @@ -1,12 +1,6 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -testprogs = clock1 clock2 +tests_pass = clock1 clock2 +tests_fail = -TESTS = $(testprogs) - -check_PROGRAMS = $(testprogs) - -LDADD = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) diff --git a/testsuite/debug/Makefile.am b/testsuite/debug/Makefile.am index 67513d757..dfcfd0271 100644 --- a/testsuite/debug/Makefile.am +++ b/testsuite/debug/Makefile.am @@ -1,10 +1,5 @@ -#testprogs = global output commandline category -testprogs = commandline category +include ../Rules -TESTS = $(testprogs) +tests_pass = commandline category global output +tests_fail = -check_PROGRAMS = $(testprogs) - -# we have nothing but apps here, we can do this safely -LIBS = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) diff --git a/testsuite/dynparams/Makefile.am b/testsuite/dynparams/Makefile.am index 69cbfe71e..119eeed26 100644 --- a/testsuite/dynparams/Makefile.am +++ b/testsuite/dynparams/Makefile.am @@ -1,10 +1,10 @@ -testprogs = dparamstest +include ../Rules -TESTS = $(testprogs) - -check_PROGRAMS = $(testprogs) +tests_pass = +tests_fail = dparamstest dparamstest_CFLAGS = $(GST_CFLAGS) -dparamstest_LDFLAGS = $(GST_LIBS) -L$(top_builddir)/libs/gst/control/ -lgstcontrol +dparamstest_LDFLAGS = $(GST_LIBS) +dparamstest_LDADD = $(top_builddir)/libs/gst/control/libgstcontrol-@GST_MAJORMINOR@.la dparamstest_SOURCES = dparamstest.c diff --git a/testsuite/dynparams/dparamstest.c b/testsuite/dynparams/dparamstest.c index 0e576f19f..6f1fbb222 100644 --- a/testsuite/dynparams/dparamstest.c +++ b/testsuite/dynparams/dparamstest.c @@ -21,6 +21,9 @@ #include <stdlib.h> #include <string.h> +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include <gst/gst.h> #include <gst/control/control.h> @@ -59,6 +62,7 @@ GType gst_dptest_get_type (void); GstElementDetails gst_dptest_details = { "DParamsTest", "Filter", + "LGPL", "Test for the GstDParam code", VERSION, "Steve Baker <stevebaker_org@yahoo.co.uk>", @@ -78,7 +82,7 @@ static void gst_dptest_set_property (GObject * object, guint prop_id, const GVal GParamSpec * pspec); static GstElementStateReturn gst_dptest_change_state (GstElement *element); -static void gst_dptest_chain (GstPad *pad, GstBuffer *buf); +static void gst_dptest_chain (GstPad *pad, GstData *buf); static GstElementClass *parent_class = NULL; @@ -178,10 +182,10 @@ gst_dptest_change_state (GstElement *element) } static void -gst_dptest_chain (GstPad *pad, GstBuffer *buf) +gst_dptest_chain (GstPad *pad, GstData *data) { GstDpTest *dptest; - gint i=0, frame_countdown; + gint frame_countdown; dptest = GST_DPTEST(gst_pad_get_parent (pad)); g_assert(dptest); @@ -189,7 +193,7 @@ gst_dptest_chain (GstPad *pad, GstBuffer *buf) /* we're using a made up buffer size of 64 and a timestamp of zero */ frame_countdown = GST_DPMAN_PREPROCESS(dptest->dpman, 64, 0LL); - while(GST_DPMAN_PROCESS_COUNTDOWN(dptest->dpman, frame_countdown, i)); + while(GST_DPMAN_PROCESS(dptest->dpman, frame_countdown)); g_print("dp chain\n"); } diff --git a/testsuite/elements/Makefile.am b/testsuite/elements/Makefile.am index af78be061..232f10e46 100644 --- a/testsuite/elements/Makefile.am +++ b/testsuite/elements/Makefile.am @@ -1,18 +1,7 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -if BUILD_FAILING_TESTS -tests_failing = fake -else -tests_failing = -endif -tests_working = name tee property +tests_pass = name tee property fake +tests_fail = -TESTS = $(tests_working) - -check_PROGRAMS = $(tests_failing) $(tests_working) - -EXTRA_DIST = property.h -LDADD = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) +noinst_HEADERS = property.h diff --git a/testsuite/indexers/Makefile.am b/testsuite/indexers/Makefile.am index e1c8d6e36..76730104e 100644 --- a/testsuite/indexers/Makefile.am +++ b/testsuite/indexers/Makefile.am @@ -1,11 +1,6 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -testprogs = cache1 indexdump +tests_pass = cache1 indexdump +tests_fail = -TESTS = $(testprogs) -check_PROGRAMS = $(testprogs) - -LDADD = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) diff --git a/testsuite/parse/Makefile.am b/testsuite/parse/Makefile.am index 0c431f77b..3edad6d06 100644 --- a/testsuite/parse/Makefile.am +++ b/testsuite/parse/Makefile.am @@ -1,12 +1,8 @@ +include ../Rules -check_PROGRAMS = parse1 parse2 - -# parse1 is broken -TESTS = parse2 +tests_pass = parse2 +tests_fail = parse1 parse1_SOURCES = parse1.c parse2_SOURCES = parse2.c -# we have nothing but apps here, we can do this safely -LIBS = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) diff --git a/testsuite/parse/parse1.c b/testsuite/parse/parse1.c index 4598e9735..debf5ff0d 100644 --- a/testsuite/parse/parse1.c +++ b/testsuite/parse/parse1.c @@ -21,6 +21,7 @@ #include <gst/gst.h> #include <string.h> +#include <unistd.h> /* variables used by the TEST_* macros */ static gint test = 0; @@ -58,6 +59,7 @@ static gchar *s; g_print ("TEST %2d line %3d COMPLETE\n", test, __LINE__); \ }G_STMT_END #define TEST_RUN G_STMT_START{ \ + alarm(10); \ g_print ("TEST %2d line %3d RUN\n", test, __LINE__); \ if (gst_element_set_state (cur, GST_STATE_PLAYING) == GST_STATE_FAILURE) { \ g_print ("TEST %2d line %3d FAILED : pipeline could not be set to state PLAYING\n", test, __LINE__); \ @@ -70,6 +72,7 @@ static gchar *s; return -test; \ } \ g_print ("TEST %2d line %3d STOPPED : %u iterations\n", test, __LINE__, iterations); \ + alarm(0); \ }G_STMT_END #define PIPELINE1 "fakesrc" #define PIPELINE2 "fakesrc name=donald num-buffers= 27 silent =TruE sizetype = 3 eos = yesyo data= Subbuffer\\ data" diff --git a/testsuite/plugin/Makefile.am b/testsuite/plugin/Makefile.am index 4ef486d3a..a8d1887bb 100644 --- a/testsuite/plugin/Makefile.am +++ b/testsuite/plugin/Makefile.am @@ -1,13 +1,10 @@ -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(top_builddir) GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml +include ../Rules -plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ plugin_LTLIBRARIES = libtestplugin.la libtestplugin2.la -# FIXME : tests need fixing -testprogs = static dynamic linked loading registry static2 +tests_pass = static dynamic static2 linked loading registry +tests_fail = -AM_CFLAGS = $(GST_CFLAGS) -LIBS = $(GST_LIBS) libtestplugin_la_SOURCES = testplugin.c libtestplugin_la_CFLAGS = $(GST_CFLAGS) @@ -20,10 +17,3 @@ linked_LIBS = libtestplugin.la libtestplugin2.la static_SOURCES = static.c testplugin_s.c testplugin2_s.c -check_PROGRAMS = $(testprogs) - -TESTS = $(top_builddir)/tools/gst-register $(testprogs) - -# override to _not_ install the test plugins -install-pluginLTLIBRARIES: - diff --git a/testsuite/refcounting/Makefile.am b/testsuite/refcounting/Makefile.am index b7fbe2236..41365ece2 100644 --- a/testsuite/refcounting/Makefile.am +++ b/testsuite/refcounting/Makefile.am @@ -1,29 +1,15 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -if BUILD_FAILING_TESTS -tests_failing = element bin element_pad pad -else -tests_failing = -endif -tests_working = mainloop sched +tests_pass = bin element mainloop pad +tests_fail = element_pad sched element_SOURCES = element.c mem.c pad_SOURCES = pad.c mem.c - element_pad_SOURCES = element_pad.c mem.c bin_SOURCES = bin.c mem.c -TESTS = $(tests_working) - -check_PROGRAMS = $(TESTS) -noinst_PROGRAMS = $(tests_failing) - EXTRA_DIST = thread.c object.c noinst_HEADERS = mem.h -# we have nothing but apps here, we can do this safely -LIBS = $(GST_LIBS) -AM_CFLAGS = $(GLIB_CFLAGS) $(XML_CFLAGS) $(GST_CFLAGS) diff --git a/testsuite/refcounting/bin.c b/testsuite/refcounting/bin.c index a2811fac5..81c867180 100644 --- a/testsuite/refcounting/bin.c +++ b/testsuite/refcounting/bin.c @@ -1,8 +1,7 @@ #include <gst/gst.h> -#define ITERS 100000 +#define ITERS 100 #include <stdlib.h> -#include "mem.h" static GstElement* create_bin (void) @@ -73,12 +72,16 @@ add_remove_test2 (void) g_assert (!GST_OBJECT_DESTROYED (element)); gst_object_unref (GST_OBJECT (element)); +#if 0 g_assert (GST_OBJECT_DESTROYED (element)); gst_object_unref (GST_OBJECT (element)); +#endif gst_object_unref (GST_OBJECT (bin)); } +#if 0 +/* This code is bogus */ static void add_remove_test3 (void) { @@ -97,7 +100,10 @@ add_remove_test3 (void) gst_object_unref (GST_OBJECT (bin)); } +#endif +#if 0 +/* This code is bogus */ static void add_remove_test4 (void) { @@ -123,14 +129,17 @@ add_remove_test4 (void) gst_object_unref (GST_OBJECT (bin)); } +#endif int main (int argc, gchar *argv[]) { GstElement *bin; - long usage1; + int usage1; gint i, iters; + gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE); + gst_init (&argc, &argv); if (argc == 2) @@ -138,18 +147,21 @@ main (int argc, gchar *argv[]) else iters = ITERS; + g_print ("starting test\n"); - usage1 = vmsize(); + + usage1 = gst_alloc_trace_live_all (); + //gst_alloc_trace_print_all (); bin = gst_bin_new ("somebin"); gst_object_unref (GST_OBJECT (bin)); - g_print ("create/unref new bin %ld\n", vmsize()-usage1); + g_print ("create/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = gst_bin_new ("somebin"); gst_object_unref (GST_OBJECT (bin)); } - g_print ("create/unref %d bins %ld\n", iters, vmsize()-usage1); + g_print ("create/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1); bin = gst_bin_new ("somebin"); g_assert (GST_OBJECT_FLOATING (bin)); @@ -157,7 +169,7 @@ main (int argc, gchar *argv[]) gst_object_sink (GST_OBJECT (bin)); g_assert (!GST_OBJECT_FLOATING (bin)); gst_object_unref (GST_OBJECT (bin)); - g_print ("create/ref/sink/unref new bin %ld\n", vmsize()-usage1); + g_print ("create/ref/sink/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { @@ -166,27 +178,31 @@ main (int argc, gchar *argv[]) gst_object_sink (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); } - g_print ("create/ref/sink/unref %d bins %ld\n", iters, vmsize()-usage1); + g_print ("create/ref/sink/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1); bin = gst_bin_new ("somebin"); g_assert (!GST_OBJECT_DESTROYED (bin)); gst_object_unref (GST_OBJECT (bin)); +#if 0 g_assert (GST_OBJECT_DESTROYED (bin)); gst_object_unref (GST_OBJECT (bin)); - g_print ("create/destroy/unref new bin %ld\n", vmsize()-usage1); +#endif + g_print ("create/destroy/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = gst_bin_new ("somebin"); gst_object_unref (GST_OBJECT (bin)); +#if 0 gst_object_unref (GST_OBJECT (bin)); +#endif } - g_print ("create/destroy/unref %d bin %ld\n", iters, vmsize()-usage1); + g_print ("create/destroy/unref %d bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); bin = gst_bin_new ("somebin"); gst_object_ref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); - g_print ("create/ref/unref/unref new bin %ld\n", vmsize()-usage1); + g_print ("create/ref/unref/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = gst_bin_new ("somebin"); @@ -194,23 +210,27 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); } - g_print ("create/ref/unref/unref %d bin %ld\n", iters, vmsize()-usage1); + g_print ("create/ref/unref/unref %d bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); bin = gst_bin_new ("somebin"); gst_object_ref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); +#if 0 gst_object_unref (GST_OBJECT (bin)); - g_print ("craete/ref/destroy/unref/unref new bin %ld\n", vmsize()-usage1); +#endif + g_print ("craete/ref/destroy/unref/unref new bin %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = gst_bin_new ("somebin"); gst_object_ref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); gst_object_unref (GST_OBJECT (bin)); +#if 0 gst_object_unref (GST_OBJECT (bin)); +#endif } - g_print ("craete/ref/destroy/unref/unref %d bins %ld\n", iters, vmsize()-usage1); + g_print ("craete/ref/destroy/unref/unref %d bins %d\n", iters, gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = gst_bin_new ("somebin"); @@ -219,50 +239,58 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (bin)); gst_element_set_name (bin, "testing123"); gst_object_unref (GST_OBJECT (bin)); +#if 0 gst_object_unref (GST_OBJECT (bin)); +#endif } - g_print ("craete/ref/destroy/unref/unref %d bins with name %ld\n", iters, vmsize()-usage1); + g_print ("craete/ref/destroy/unref/unref %d bins with name %d\n", iters, gst_alloc_trace_live_all ()-usage1); bin = gst_bin_new ("somebin"); for (i=0; i<iters;i++) { gst_element_set_name (bin, "testing"); } gst_object_unref (GST_OBJECT (bin)); - g_print ("set name %d times %ld\n", iters, vmsize()-usage1); + g_print ("set name %d times %d\n", iters, gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { bin = create_bin(); gst_object_unref (GST_OBJECT (bin)); } - g_print ("create/unref %d bin with children %ld\n", iters, vmsize()-usage1); + g_print ("create/unref %d bin with children %d\n", iters, gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters/2;i++) { bin = create_bin_ghostpads(); gst_object_unref (GST_OBJECT (bin)); } - g_print ("create/unref %d bin with children and ghostpads %ld\n", iters/2, vmsize()-usage1); + g_print ("create/unref %d bin with children and ghostpads %d\n", iters/2, gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { add_remove_test1(); } - g_print ("add/remove test1 %d in bin %ld\n", iters, vmsize()-usage1); + g_print ("add/remove test1 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { add_remove_test2(); } - g_print ("add/remove test2 %d in bin %ld\n", iters, vmsize()-usage1); + g_print ("add/remove test2 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#if 0 for (i=0; i<iters;i++) { add_remove_test3(); } - g_print ("add/destroy/remove test3 %d in bin %ld\n", iters, vmsize()-usage1); + g_print ("add/destroy/remove test3 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { add_remove_test4(); } - g_print ("add/destroy/remove test4 %d in bin %ld\n", iters, vmsize()-usage1); + g_print ("add/destroy/remove test4 %d in bin %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#endif + + g_print ("leaked: %d\n", gst_alloc_trace_live_all ()-usage1); - g_print ("leaked: %ld\n", vmsize()-usage1); + //gst_alloc_trace_print_all (); - return (vmsize()-usage1 ? -1 : 0); + return (gst_alloc_trace_live_all ()-usage1 ? -1 : 0); } diff --git a/testsuite/refcounting/element.c b/testsuite/refcounting/element.c index f8f299eda..78d36106e 100644 --- a/testsuite/refcounting/element.c +++ b/testsuite/refcounting/element.c @@ -1,14 +1,13 @@ #include <gst/gst.h> -#define ITERS 10000 +#define ITERS 100 #include <stdlib.h> -#include "mem.h" int main (int argc, gchar *argv[]) { GstElement *element; - long usage1; + int usage1; gint i, iters; gst_init (&argc, &argv); @@ -19,17 +18,19 @@ main (int argc, gchar *argv[]) iters = ITERS; g_print ("starting test\n"); - usage1 = vmsize(); + + usage1 = gst_alloc_trace_live_all (); + //gst_alloc_trace_print_all (); element = gst_element_factory_make ("fakesrc", NULL); gst_object_unref (GST_OBJECT (element)); - g_print ("create/unref new element %ld\n", vmsize()-usage1); + g_print ("create/unref new element %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { element = gst_element_factory_make ("fakesrc", NULL); gst_object_unref (GST_OBJECT (element)); } - g_print ("create/unref %d elements %ld\n", iters, vmsize()-usage1); + g_print ("create/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1); element = gst_element_factory_make ("fakesrc", NULL); g_assert (GST_OBJECT_FLOATING (element)); @@ -37,7 +38,7 @@ main (int argc, gchar *argv[]) gst_object_sink (GST_OBJECT (element)); g_assert (!GST_OBJECT_FLOATING (element)); gst_object_unref (GST_OBJECT (element)); - g_print ("create/ref/sink/unref new element %ld\n", vmsize()-usage1); + g_print ("create/ref/sink/unref new element %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { @@ -46,27 +47,31 @@ main (int argc, gchar *argv[]) gst_object_sink (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); } - g_print ("create/ref/sink/unref %d elements %ld\n", iters, vmsize()-usage1); + g_print ("create/ref/sink/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#if 0 element = gst_element_factory_make ("fakesrc", NULL); g_assert (!GST_OBJECT_DESTROYED (element)); gst_object_unref (GST_OBJECT (element)); g_assert (GST_OBJECT_DESTROYED (element)); gst_object_unref (GST_OBJECT (element)); - g_print ("create/destroy/unref new element %ld\n", vmsize()-usage1); + g_print ("create/destroy/unref new element %d\n", gst_alloc_trace_live_all ()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { element = gst_element_factory_make ("fakesrc", NULL); gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); } - g_print ("create/destroy/unref %d element %ld\n", iters, vmsize()-usage1); + g_print ("create/destroy/unref %d element %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#endif element = gst_element_factory_make ("fakesrc", NULL); gst_object_ref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); - g_print ("create/ref/unref/unref new element %ld\n", vmsize()-usage1); + g_print ("create/ref/unref/unref new element %d\n", gst_alloc_trace_live_all ()-usage1); for (i=0; i<iters;i++) { element = gst_element_factory_make ("fakesrc", NULL); @@ -74,15 +79,18 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); } - g_print ("create/ref/unref/unref %d element %ld\n", iters, vmsize()-usage1); + g_print ("create/ref/unref/unref %d element %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#if 0 element = gst_element_factory_make ("fakesrc", NULL); gst_object_ref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); - g_print ("craete/ref/destroy/unref/unref new element %ld\n", vmsize()-usage1); + g_print ("craete/ref/destroy/unref/unref new element %d\n", gst_alloc_trace_live_all ()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { element = gst_element_factory_make ("fakesrc", NULL); gst_object_ref (GST_OBJECT (element)); @@ -90,8 +98,10 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); } - g_print ("craete/ref/destroy/unref/unref %d elements %ld\n", iters, vmsize()-usage1); + g_print ("craete/ref/destroy/unref/unref %d elements %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { element = gst_element_factory_make ("fakesrc", NULL); gst_object_ref (GST_OBJECT (element)); @@ -101,16 +111,17 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element)); } - g_print ("craete/ref/destroy/unref/unref %d elements with name %ld\n", iters, vmsize()-usage1); + g_print ("craete/ref/destroy/unref/unref %d elements with name %d\n", iters, gst_alloc_trace_live_all ()-usage1); +#endif element = gst_element_factory_make ("fakesrc", NULL); for (i=0; i<iters;i++) { gst_element_set_name (element, "testing"); } gst_object_unref (GST_OBJECT (element)); - g_print ("set name %d times %ld\n", iters, vmsize()-usage1); + g_print ("set name %d times %d\n", iters, gst_alloc_trace_live_all ()-usage1); - g_print ("leaked: %ld\n", vmsize()-usage1); + g_print ("leaked: %d\n", gst_alloc_trace_live_all ()-usage1); - return (vmsize()-usage1 ? -1 : 0); + return (gst_alloc_trace_live_all ()-usage1 ? -1 : 0); } diff --git a/testsuite/refcounting/element_pad.c b/testsuite/refcounting/element_pad.c index cbcf22ecc..f0cf572e0 100644 --- a/testsuite/refcounting/element_pad.c +++ b/testsuite/refcounting/element_pad.c @@ -1,6 +1,6 @@ #include <gst/gst.h> -#define ITERS 100000 +#define ITERS 100 #include <stdlib.h> #include "mem.h" diff --git a/testsuite/refcounting/pad.c b/testsuite/refcounting/pad.c index 1aa259bb2..a353c5dd7 100644 --- a/testsuite/refcounting/pad.c +++ b/testsuite/refcounting/pad.c @@ -1,6 +1,6 @@ #include <gst/gst.h> -#define ITERS 100000 +#define ITERS 100 #include <stdlib.h> #include "mem.h" @@ -12,13 +12,19 @@ main (int argc, gchar *argv[]) long usage1; gint i, iters; + gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE); + gst_init (&argc, &argv); + g_mem_profile (); + if (argc == 2) iters = atoi (argv[1]); else iters = ITERS; + //gst_alloc_trace_print_all (); + g_print ("starting pad test\n"); usage1 = vmsize(); @@ -48,19 +54,23 @@ main (int argc, gchar *argv[]) } g_print ("create/ref/sink/unref %d pads %ld\n", iters, vmsize()-usage1); +#if 0 pad = gst_pad_new ("padname", GST_PAD_SINK); g_assert (!GST_OBJECT_DESTROYED (pad)); gst_object_unref (GST_OBJECT (pad)); g_assert (GST_OBJECT_DESTROYED (pad)); gst_object_unref (GST_OBJECT (pad)); g_print ("create/destroy/unref pad %ld\n", vmsize()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { pad = gst_pad_new ("padname", GST_PAD_SINK); gst_object_unref (GST_OBJECT (pad)); gst_object_unref (GST_OBJECT (pad)); } g_print ("create/destroy/unref %d pads %ld\n", iters, vmsize()-usage1); +#endif pad = gst_pad_new ("padname", GST_PAD_SINK); gst_object_ref (GST_OBJECT (pad)); @@ -80,18 +90,23 @@ main (int argc, gchar *argv[]) gst_object_ref (GST_OBJECT (pad)); gst_object_unref (GST_OBJECT (pad)); gst_object_unref (GST_OBJECT (pad)); +#if 0 gst_object_unref (GST_OBJECT (pad)); +#endif g_print ("create/ref/destroy/unref/unref pad %ld\n", vmsize()-usage1); +#if 0 for (i=0; i<iters;i++) { pad = gst_pad_new ("padname", GST_PAD_SINK); gst_object_ref (GST_OBJECT (pad)); gst_object_unref (GST_OBJECT (pad)); gst_object_unref (GST_OBJECT (pad)); - gst_object_unref (GST_OBJECT (pad)); + //gst_object_unref (GST_OBJECT (pad)); } g_print ("create/ref/destroy/unref/unref %d pads %ld\n", iters, vmsize()-usage1); +#endif +#if 0 for (i=0; i<iters;i++) { pad = gst_pad_new ("padname", GST_PAD_SINK); gst_object_ref (GST_OBJECT (pad)); @@ -102,6 +117,7 @@ main (int argc, gchar *argv[]) gst_object_unref (GST_OBJECT (pad)); } g_print ("create/ref/destroy/unref/unref %d pads %ld with name\n", iters, vmsize()-usage1); +#endif pad = gst_pad_new ("padname", GST_PAD_SINK); for (i=0; i<iters;i++) { @@ -125,5 +141,7 @@ main (int argc, gchar *argv[]) g_print ("leaked: %ld\n", vmsize()-usage1); + //gst_alloc_trace_print_all (); + return vmsize()-usage1; } diff --git a/testsuite/refcounting/sched.c b/testsuite/refcounting/sched.c index 3c057e498..7294beecd 100644 --- a/testsuite/refcounting/sched.c +++ b/testsuite/refcounting/sched.c @@ -11,7 +11,7 @@ make_and_check_element (gchar *type, gchar *name) if (element == NULL) { g_warning ("Could not run test, because element type \"%s\" is not installed. Please retry when it is. Assuming it works for now...", type); - exit (0); + exit (1); } return element; diff --git a/testsuite/states/Makefile.am b/testsuite/states/Makefile.am index 8f8ee1034..2c7020fa6 100644 --- a/testsuite/states/Makefile.am +++ b/testsuite/states/Makefile.am @@ -1,11 +1,8 @@ -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 +include ../Rules -testprogs = locked +tests_pass = locked +tests_fail = -TESTS = $(testprogs) - -check_PROGRAMS = $(testprogs) locked_LDADD = $(GST_LIBS) locked_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS) diff --git a/testsuite/threads/Makefile.am b/testsuite/threads/Makefile.am index 0f013b9df..203724bed 100644 --- a/testsuite/threads/Makefile.am +++ b/testsuite/threads/Makefile.am @@ -1,17 +1,8 @@ -TOP_BUILDDIR=$(shell cd $(top_builddir) && pwd) -TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(TOP_BUILDDIR) GST_REGISTRY=$(TOP_BUILDDIR)/testsuite/test-registry.xml +include ../Rules -testprogs = thread1 thread2 thread5 -testsfailing = threadb threadc threadd threade threadf thread4 queue thread3 +tests_pass = thread1 thread2 thread3 thread4 threadf +tests_fail = thread5 threadb threadc threadd threade queue -TESTS = $(testprogs) - -check_PROGRAMS = $(testprogs) - -noinst_PROGRAMS = $(testsfailing) - -LDADD = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) queue_SOURCES = queue.c queue_CFLAGS = $(AM_CFLAGS) diff --git a/testsuite/threads/thread.c b/testsuite/threads/thread.c index eece4d000..2054986f2 100644 --- a/testsuite/threads/thread.c +++ b/testsuite/threads/thread.c @@ -35,7 +35,7 @@ construct_pipeline (GstElement *pipeline) gst_bin_add_many (GST_BIN (thread), identity, sink, NULL); g_object_set (G_OBJECT (src), "num_buffers", 5, NULL); - g_object_set (sink, "signal-handoff", TRUE, NULL); + g_object_set (sink, "signal-handoffs", TRUE, NULL); } void @@ -106,7 +106,7 @@ main (gint argc, gchar *argv[]) gst_element_set_state (pipeline, GST_STATE_NULL); } if (TESTNUM == 5) { - /* I don't this test is supposed to work */ + /* I don't think this test is supposed to work */ GstElement *sink; sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink"); diff --git a/testsuite/threads/threadd.c b/testsuite/threads/threadd.c index 13147fa48..e9ff75360 100644 --- a/testsuite/threads/threadd.c +++ b/testsuite/threads/threadd.c @@ -1,4 +1,5 @@ #include <gst/gst.h> +#include <unistd.h> /* threadc.c * this tests if we can make a GstThread, with enough cothreads to stress it @@ -59,6 +60,8 @@ main (gint argc, gchar *argv[]) gulong id; GstElement *thread; + alarm(10); + gst_init (&argc, &argv); for (i = 0; i < runs; ++i) diff --git a/testsuite/threads/threade.c b/testsuite/threads/threade.c index 79e621321..98b15dd3c 100644 --- a/testsuite/threads/threade.c +++ b/testsuite/threads/threade.c @@ -1,4 +1,5 @@ #include <gst/gst.h> +#include <unistd.h> /* threadc.c * this tests if we can make a GstBin and iterate it inside a GThread @@ -54,6 +55,8 @@ main (gint argc, gchar *argv[]) int i; GstElement *pipeline; + alarm(10); + g_thread_init (NULL); gst_init (&argc, &argv); |