From: David S. <dsc...@us...> - 2003-10-15 01:26:21
|
CVS Root: /cvsroot/gstreamer Module: gstreamer Changes by: dschleef Date: Tue Oct 14 2003 18:26:19 PDT Log message: 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. Modified files: testsuite : Makefile.am testsuite/bytestream: Makefile.am gstbstest.c test1.c testsuite/caps : Makefile.am testsuite/cleanup: Makefile.am testsuite/clock : Makefile.am testsuite/debug : Makefile.am Added files: testsuite : Rules Removed files: testsuite/bytestream: mem.c mem.h Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/Makefile.am.diff?r1=1.38&r2=1.39 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/Rules?rev=1.1&content-type=text/vnd.viewcvs-markup http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/bytestream/Makefile.am.diff?r1=1.8&r2=1.9 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/bytestream/gstbstest.c.diff?r1=1.7&r2=1.8 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/bytestream/mem.c http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/bytestream/mem.h http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/bytestream/test1.c.diff?r1=1.6&r2=1.7 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/caps/Makefile.am.diff?r1=1.7&r2=1.8 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/cleanup/Makefile.am.diff?r1=1.7&r2=1.8 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/clock/Makefile.am.diff?r1=1.5&r2=1.6 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/debug/Makefile.am.diff?r1=1.2&r2=1.3 ====Begin Diffs==== Index: Makefile.am =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/testsuite/Makefile.am,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- Makefile.am 5 Jul 2003 21:04:23 -0000 1.38 +++ Makefile.am 15 Oct 2003 01:25:37 -0000 1.39 @@ -1,3 +1,6 @@ +include Rules + + if GST_DISABLE_PARSE GST_PARSE_DIRS = else @@ -10,35 +13,18 @@ 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 + --- NEW FILE: Rules --- 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.* Index: Makefile.am =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/testsuite/bytestream/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.am 12 Jan 2002 00:47:40 -0000 1.8 +++ Makefile.am 15 Oct 2003 01:25:37 -0000 1.9 @@ -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 Index: gstbstest.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/testsuite/bytestream/gstbstest.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- gstbstest.c 10 Jan 2003 04:54:18 -0000 1.7 +++ gstbstest.c 15 Oct 2003 01:25:37 -0000 1.8 @@ -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 @@ GstElementDetails gst_bstest_details = { "ByteStreamTest", "Filter", + "LGPL", "Test for the GstByteStream code", VERSION, - "Erik Walthinsen <om...@te...>," "Wim Taymans <wim...@ch...>", + "Erik Walthinsen <om...@te...>," + "Wim Taymans <wim...@ch...>", "(C) 2001", }; @@ -160,22 +165,15 @@ } -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 @@ { 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 @@ do { guint size = 0; guint i = 0; + guint8 *ptr; while (i < bstest->num_patterns) { buf = NULL; @@ -244,7 +243,7 @@ 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 @@ 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++; } @@ -384,12 +383,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, --- mem.c DELETED --- --- mem.h DELETED --- Index: test1.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/testsuite/bytestream/test1.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- test1.c 7 Aug 2003 12:45:30 -0000 1.6 +++ test1.c 15 Oct 2003 01:25:37 -0000 1.7 @@ -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 @@ 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 @@ GSList *walk; gint arg_walk; + gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE); gst_init (&argc, &argv); arg_walk = 1; Index: Makefile.am =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/testsuite/caps/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 8 Oct 2003 07:49:11 -0000 1.7 +++ Makefile.am 15 Oct 2003 01:25:38 -0000 1.8 @@ -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) Index: Makefile.am =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/testsuite/cleanup/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 18 May 2003 22:59:50 -0000 1.7 +++ Makefile.am 15 Oct 2003 01:25:38 -0000 1.8 @@ -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 - -if BUILD_FAILING_TESTS -FAILING = cleanup3 cleanup4 -else -FAILING = -endif - -testprogs = cleanup1 cleanup2 $(FAILING) cleanup5 - -TESTS = $(testprogs) +include ../Rules -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) Index: Makefile.am =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/testsuite/clock/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 18 May 2003 22:59:50 -0000 1.5 +++ Makefile.am 15 Oct 2003 01:25:38 -0000 1.6 @@ -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 - -testprogs = clock1 clock2 - -TESTS = $(testprogs) +include ../Rules -check_PROGRAMS = $(testprogs) +tests_pass = clock1 clock2 +tests_fail = -LDADD = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) Index: Makefile.am =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/testsuite/debug/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 9 Oct 2003 01:13:21 -0000 1.2 +++ Makefile.am 15 Oct 2003 01:25:38 -0000 1.3 @@ -1,10 +1,5 @@ -#testprogs = global output commandline category -testprogs = commandline category - -TESTS = $(testprogs) +include ../Rules -check_PROGRAMS = $(testprogs) +tests_pass = commandline category global output +tests_fail = -# we have nothing but apps here, we can do this safely -LIBS = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) |