diff --git a/Makefile.am b/Makefile.am index c5d93b535e..2d7139c0aa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc -SUBDIRS = ges +SUBDIRS = ges tests DIST_SUBDIRS = ges diff --git a/configure.ac b/configure.ac index 461d737652..a23ee069ec 100644 --- a/configure.ac +++ b/configure.ac @@ -240,5 +240,7 @@ common/m4/Makefile gst-editing-services.spec m4/Makefile ges/Makefile +tests/Makefile +tests/check/Makefile ) AC_OUTPUT diff --git a/ges/Makefile.am b/ges/Makefile.am index 841b7c2e81..c8b77dba47 100644 --- a/ges/Makefile.am +++ b/ges/Makefile.am @@ -24,6 +24,7 @@ libges_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/ges libges_@GST_MAJORMINOR@include_HEADERS = \ ges-types.h \ ges.h \ + ges-internal.h \ ges-simple-timeline-layer.h \ ges-timeline.h \ ges-timeline-layer.h \ diff --git a/ges/ges-internal.h b/ges/ges-internal.h new file mode 100644 index 0000000000..6589e671dc --- /dev/null +++ b/ges/ges-internal.h @@ -0,0 +1,28 @@ +/* GStreamer Editing Services + * Copyright (C) 2009 Edward Hervey + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GES_INTERNAL_H__ +#define __GES_INTERNAL_H__ + +#include + +GST_DEBUG_CATEGORY_EXTERN (ges_debug); +#define GST_CAT_DEFAULT ges_debug + +#endif /* __GES_INTERNAL_H__ */ diff --git a/ges/ges-simple-timeline-layer.c b/ges/ges-simple-timeline-layer.c index c3d70856f0..e7f8da7e0d 100644 --- a/ges/ges-simple-timeline-layer.c +++ b/ges/ges-simple-timeline-layer.c @@ -17,6 +17,7 @@ * Boston, MA 02111-1307, USA. */ +#include "ges-internal.h" #include "ges-simple-timeline-layer.h" G_DEFINE_TYPE (GESSimpleTimelineLayer, ges_simple_timeline_layer, diff --git a/ges/ges-timeline-layer.c b/ges/ges-timeline-layer.c index 253da475b4..1e03ce94c3 100644 --- a/ges/ges-timeline-layer.c +++ b/ges/ges-timeline-layer.c @@ -17,6 +17,7 @@ * Boston, MA 02111-1307, USA. */ +#include "ges-internal.h" #include "gesmarshal.h" #include "ges-timeline-layer.h" #include "ges.h" diff --git a/ges/ges-timeline-object.c b/ges/ges-timeline-object.c index 29cb0c7a0c..20c83a3892 100644 --- a/ges/ges-timeline-object.c +++ b/ges/ges-timeline-object.c @@ -17,6 +17,7 @@ * Boston, MA 02111-1307, USA. */ +#include "ges-internal.h" #include "ges-timeline-object.h" #include "ges.h" diff --git a/ges/ges-timeline-pipeline.c b/ges/ges-timeline-pipeline.c index 44bac44016..a39d06808b 100644 --- a/ges/ges-timeline-pipeline.c +++ b/ges/ges-timeline-pipeline.c @@ -17,6 +17,7 @@ * Boston, MA 02111-1307, USA. */ +#include "ges-internal.h" #include "ges-timeline-pipeline.h" /* TimelinePipeline diff --git a/ges/ges-timeline-source.c b/ges/ges-timeline-source.c index f757631f87..2451c9b191 100644 --- a/ges/ges-timeline-source.c +++ b/ges/ges-timeline-source.c @@ -17,6 +17,7 @@ * Boston, MA 02111-1307, USA. */ +#include "ges-internal.h" #include "ges-timeline-object.h" #include "ges-timeline-source.h" diff --git a/ges/ges-timeline-transition.c b/ges/ges-timeline-transition.c index cf7907b892..ee8984a20a 100644 --- a/ges/ges-timeline-transition.c +++ b/ges/ges-timeline-transition.c @@ -17,6 +17,7 @@ * Boston, MA 02111-1307, USA. */ +#include "ges-internal.h" #include "ges-timeline-transition.h" G_DEFINE_TYPE (GESTimelineTransition, ges_timeline_transition, diff --git a/ges/ges-timeline.c b/ges/ges-timeline.c index f952491b7c..6513c4a2c8 100644 --- a/ges/ges-timeline.c +++ b/ges/ges-timeline.c @@ -18,6 +18,7 @@ */ #include "gesmarshal.h" +#include "ges-internal.h" #include "ges-timeline.h" #include "ges-track.h" #include "ges-timeline-layer.h" diff --git a/ges/ges-track-object.c b/ges/ges-track-object.c index 43e785bd2e..614685188d 100644 --- a/ges/ges-track-object.c +++ b/ges/ges-track-object.c @@ -17,6 +17,7 @@ * Boston, MA 02111-1307, USA. */ +#include "ges-internal.h" #include "ges-track-object.h" #include "ges-timeline-object.h" @@ -159,12 +160,12 @@ ges_track_object_new (GESTimelineObject * timelineobj, GESTrack * track) obj = g_object_new (GES_TYPE_TRACK_OBJECT, NULL); + /* FIXME : THIS IS TOTALLY BOGUS ! */ + /* Set the timeline object and track */ obj->timelineobj = timelineobj; obj->track = track; - /* Create the associated GnlObject */ - ges_track_object_create_gnl_object (obj); return obj; } diff --git a/ges/ges-track-object.h b/ges/ges-track-object.h index 5c9bd98b36..547f322007 100644 --- a/ges/ges-track-object.h +++ b/ges/ges-track-object.h @@ -72,7 +72,7 @@ GType ges_track_object_get_type (void); GESTrackObject* ges_track_object_new (GESTimelineObject *timelineobj, GESTrack *track); -gboolean ges_track_object_create_gnl_object (GESTrackObject * object); +/* gboolean ges_track_object_create_gnl_object (GESTrackObject * object); */ void ges_track_object_set_track (GESTrackObject * object, GESTrack * track); void ges_track_object_set_timeline_object (GESTrackObject * object, GESTimelineObject * tlobject); diff --git a/ges/ges-track-source.c b/ges/ges-track-source.c index 791fd8c4cb..1be5cc9f25 100644 --- a/ges/ges-track-source.c +++ b/ges/ges-track-source.c @@ -17,6 +17,7 @@ * Boston, MA 02111-1307, USA. */ +#include "ges-internal.h" #include "ges-track-object.h" #include "ges-track-source.h" diff --git a/ges/ges-track.c b/ges/ges-track.c index bfcccc1922..4b89a25120 100644 --- a/ges/ges-track.c +++ b/ges/ges-track.c @@ -17,6 +17,7 @@ * Boston, MA 02111-1307, USA. */ +#include "ges-internal.h" #include "ges-track.h" #include "ges-track-object.h" diff --git a/ges/ges.c b/ges/ges.c index 304131d483..3880b6373a 100644 --- a/ges/ges.c +++ b/ges/ges.c @@ -18,6 +18,7 @@ */ #include +#include "ges-internal.h" GST_DEBUG_CATEGORY (ges_debug); diff --git a/ges/ges.h b/ges/ges.h index af54f437a6..b4369aa30d 100644 --- a/ges/ges.h +++ b/ges/ges.h @@ -36,9 +36,6 @@ #include #include -GST_DEBUG_CATEGORY_EXTERN (ges_debug); -#define GST_CAT_DEFAULT ges_debug - G_BEGIN_DECLS void ges_init (void); diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000000..f248d781de --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,5 @@ +if HAVE_GST_CHECK +SUBDIRS = check +else +SUBDIRS = +endif diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am new file mode 100644 index 0000000000..6742d1b3af --- /dev/null +++ b/tests/check/Makefile.am @@ -0,0 +1,27 @@ +include $(top_srcdir)/common/check.mak + +TESTS_ENVIRONMENT = + +plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ + +# override to _not_ install the test plugins +install-pluginLTLIBRARIES: + +# the core dumps of some machines have PIDs appended +CLEANFILES = core.* test-registry.* + +SUPPRESSIONS = $(top_srcdir)/common/gst.supp # $(srcdir)/gst-plugins-bad.supp + +clean-local: clean-local-check + +check_PROGRAMS = \ + ges/basic + +noinst_HEADERS = + +TESTS = $(check_PROGRAMS) + +AM_CFLAGS = $(GST_OBJ_CFLAGS) $(GST_CHECK_CFLAGS) $(CHECK_CFLAGS) $(GST_OPTION_CFLAGS) -I$(top_srcdir) +LDADD = $(GST_OBJ_LIBS) $(GST_CHECK_LIBS) $(CHECK_LIBS) $(top_builddir)/ges/libges-@GST_MAJORMINOR@.la -lges-@GST_MAJORMINOR@ + +EXTRA_DIST = #gst-plugins-bad.supp diff --git a/tests/check/ges/basic.c b/tests/check/ges/basic.c new file mode 100644 index 0000000000..7ad415506f --- /dev/null +++ b/tests/check/ges/basic.c @@ -0,0 +1,59 @@ +/* GStreamer Editing Services + * Copyright (C) 2009 Edward Hervey + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include + +GST_START_TEST (test_ges_init) +{ + /* Yes, I know.. minimalistic... */ + ges_init (); +} + +GST_END_TEST; + +static Suite * +ges_suite (void) +{ + Suite *s = suite_create ("ges"); + TCase *tc_chain = tcase_create ("basic"); + + suite_add_tcase (s, tc_chain); + + tcase_add_test (tc_chain, test_ges_init); + + return s; +} + +int +main (int argc, char **argv) +{ + int nf; + + Suite *s = ges_suite (); + SRunner *sr = srunner_create (s); + + gst_check_init (&argc, &argv); + + srunner_run_all (sr, CK_NORMAL); + nf = srunner_ntests_failed (sr); + srunner_free (sr); + + return nf; +}