mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-24 01:24:20 +00:00
Add unit test system. Adjust GST_DEBUG usage.
This commit is contained in:
parent
7860b814d6
commit
12777c8532
20 changed files with 137 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
|
||||
|
||||
SUBDIRS = ges
|
||||
SUBDIRS = ges tests
|
||||
|
||||
DIST_SUBDIRS = ges
|
||||
|
||||
|
|
|
@ -240,5 +240,7 @@ common/m4/Makefile
|
|||
gst-editing-services.spec
|
||||
m4/Makefile
|
||||
ges/Makefile
|
||||
tests/Makefile
|
||||
tests/check/Makefile
|
||||
)
|
||||
AC_OUTPUT
|
||||
|
|
|
@ -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 \
|
||||
|
|
28
ges/ges-internal.h
Normal file
28
ges/ges-internal.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/* GStreamer Editing Services
|
||||
* Copyright (C) 2009 Edward Hervey <bilboed@bilboed.com>
|
||||
*
|
||||
* 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/gst.h>
|
||||
|
||||
GST_DEBUG_CATEGORY_EXTERN (ges_debug);
|
||||
#define GST_CAT_DEFAULT ges_debug
|
||||
|
||||
#endif /* __GES_INTERNAL_H__ */
|
|
@ -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,
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "ges-internal.h"
|
||||
#include "gesmarshal.h"
|
||||
#include "ges-timeline-layer.h"
|
||||
#include "ges.h"
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "ges-internal.h"
|
||||
#include "ges-timeline-object.h"
|
||||
#include "ges.h"
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "ges-internal.h"
|
||||
#include "ges-timeline-pipeline.h"
|
||||
|
||||
/* TimelinePipeline
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "ges-internal.h"
|
||||
#include "ges-timeline-object.h"
|
||||
#include "ges-timeline-source.h"
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
#include "gesmarshal.h"
|
||||
#include "ges-internal.h"
|
||||
#include "ges-timeline.h"
|
||||
#include "ges-track.h"
|
||||
#include "ges-timeline-layer.h"
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "ges-internal.h"
|
||||
#include "ges-track-object.h"
|
||||
#include "ges-track-source.h"
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "ges-internal.h"
|
||||
#include "ges-track.h"
|
||||
#include "ges-track-object.h"
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
#include <ges/ges.h>
|
||||
#include "ges-internal.h"
|
||||
|
||||
GST_DEBUG_CATEGORY (ges_debug);
|
||||
|
||||
|
|
|
@ -36,9 +36,6 @@
|
|||
#include <ges/ges-track-object.h>
|
||||
#include <ges/ges-track-source.h>
|
||||
|
||||
GST_DEBUG_CATEGORY_EXTERN (ges_debug);
|
||||
#define GST_CAT_DEFAULT ges_debug
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void ges_init (void);
|
||||
|
|
5
tests/Makefile.am
Normal file
5
tests/Makefile.am
Normal file
|
@ -0,0 +1,5 @@
|
|||
if HAVE_GST_CHECK
|
||||
SUBDIRS = check
|
||||
else
|
||||
SUBDIRS =
|
||||
endif
|
27
tests/check/Makefile.am
Normal file
27
tests/check/Makefile.am
Normal file
|
@ -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
|
59
tests/check/ges/basic.c
Normal file
59
tests/check/ges/basic.c
Normal file
|
@ -0,0 +1,59 @@
|
|||
/* GStreamer Editing Services
|
||||
* Copyright (C) 2009 Edward Hervey <bilboed@bilboed.com>
|
||||
*
|
||||
* 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 <ges/ges.h>
|
||||
#include <gst/check/gstcheck.h>
|
||||
|
||||
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;
|
||||
}
|
Loading…
Reference in a new issue