gobject-introspection r154 - in trunk: . tests/parser
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r154 - in trunk: . tests/parser
- Date: Tue, 11 Mar 2008 23:22:55 +0000 (GMT)
Author: johan
Date: Tue Mar 11 23:22:55 2008
New Revision: 154
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=154&view=rev
Log:
2008-03-12 Johan Dahlin <johan gnome org>
* tests/parser/Foo-expected.gidl:
* tests/parser/Makefile.am:
* tests/parser/foo-object.h:
* tests/parser/foo.c:
* tests/parser/utility-expected.gidl:
* tests/parser/utility.c:
* tests/parser/utility.h:
Add a new gidl test. 'utility.gidl', which is used to be able
to test external type references. Add a reference to UtilityObject*
in the idl file.
Added:
trunk/tests/parser/utility-expected.gidl
trunk/tests/parser/utility.c
trunk/tests/parser/utility.h
Modified:
trunk/ChangeLog
trunk/tests/parser/ (props changed)
trunk/tests/parser/Foo-expected.gidl
trunk/tests/parser/Makefile.am
trunk/tests/parser/foo-object.h
trunk/tests/parser/foo.c
Modified: trunk/tests/parser/Foo-expected.gidl
==============================================================================
--- trunk/tests/parser/Foo-expected.gidl (original)
+++ trunk/tests/parser/Foo-expected.gidl Tue Mar 11 23:22:55 2008
@@ -58,6 +58,12 @@
<parameter name="object" type="FooObject*"/>
</parameters>
</method>
+ <method name="external_type" symbol="foo_object_external_type">
+ <return-type type="UtilityObject*"/>
+ <parameters>
+ <parameter name="object" type="FooObject*"/>
+ </parameters>
+ </method>
<method name="in" symbol="foo_object_in">
<return-type type="gint"/>
<parameters>
Modified: trunk/tests/parser/Makefile.am
==============================================================================
--- trunk/tests/parser/Makefile.am (original)
+++ trunk/tests/parser/Makefile.am Tue Mar 11 23:22:55 2008
@@ -1,26 +1,36 @@
-testlib_LTLIBRARIES = libfoo.la
+testlib_LTLIBRARIES = libfoo.la libutility.la
testlibdir = /tmp
install-testlibLTLIBRARIES: # prevent it from being installed
libfoo_la_SOURCES = foo.c foo-object.h
-
libfoo_la_CFLAGS = $(GOBJECT_CFLAGS)
libfoo_la_LDFLAGS = -module -avoid-version
libfoo_la_LIBADD = $(GOBJECT_LIBS)
-CLEANFILES = Foo.gidl
-EXTRA_DIST = Foo-expected.gidl
+libutility_la_SOURCES = utility.c utility.h
+libutility_la_CFLAGS = $(GOBJECT_CFLAGS)
+libutility_la_LDFLAGS = -module -avoid-version
+libutility_la_LIBADD = $(GOBJECT_LIBS)
+
+CLEANFILES = utility.gidl Foo.gidl
+EXTRA_DIST = utility-expected.gidl Foo-expected.gidl
-SCANSOURCES = $(srcdir)/foo.c $(srcdir)/foo-object.h
+utility.gidl: libutility.la utility.h $(top_builddir)/tools/g-idl-scanner
+ G_DEBUG=fatal_warnings $(top_builddir)/tools/g-idl-scanner -v \
+ --namespace=utility \
+ $(libutility_la_SOURCES) -I$(srcdir) $(GOBJECT_CFLAGS) \
+ libutility.la --output $@
Foo.gidl: libfoo.la foo-object.h $(top_builddir)/tools/g-idl-scanner
G_DEBUG=fatal_warnings $(top_builddir)/tools/g-idl-scanner -v \
--namespace=Foo \
--include-idl=$(top_srcdir)/gidl/gobject-2.0.gidl \
- $(SCANSOURCES) -I$(srcdir) $(GOBJECT_CFLAGS) \
+ --include-idl=$(srcdir)/utility.gidl \
+ $(libfoo_la_SOURCES) -I$(srcdir) $(GOBJECT_CFLAGS) \
libfoo.la --output $@
-check-local: Foo.gidl
+check-local: utility.gidl Foo.gidl
+ @diff -u -U 10 $(srcdir)/utility-expected.gidl utility.gidl && echo "utility.gidl"
@diff -u -U 10 $(srcdir)/Foo-expected.gidl Foo.gidl && echo "Foo.gidl"
@echo "======================="
@echo "All parser tests passed"
Modified: trunk/tests/parser/foo-object.h
==============================================================================
--- trunk/tests/parser/foo-object.h (original)
+++ trunk/tests/parser/foo-object.h Tue Mar 11 23:22:55 2008
@@ -2,6 +2,7 @@
#define __FOO_OBJECT_H__
#include <glib-object.h>
+#include "utility.h"
#define FOO_TYPE_INTERFACE (foo_interface_get_type ())
#define FOO_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), FOO_TYPE_INTERFACE, FooInterface))
@@ -44,6 +45,7 @@
GType foo_object_get_type (void) G_GNUC_CONST;
FooObject* foo_object_new ();
gint foo_object_method (FooObject *object);
+UtilityObject* foo_object_external_type (FooObject *object);
gint foo_object_out (FooObject *object,
int *outarg);
GObject* foo_object_create_object (FooObject *object);
Modified: trunk/tests/parser/foo.c
==============================================================================
--- trunk/tests/parser/foo.c (original)
+++ trunk/tests/parser/foo.c Tue Mar 11 23:22:55 2008
@@ -56,6 +56,12 @@
return 1;
}
+UtilityObject*
+foo_object_external_type (FooObject *object)
+{
+
+}
+
/**
* foo_object_out:
* @object: a #GObject
Added: trunk/tests/parser/utility-expected.gidl
==============================================================================
--- (empty file)
+++ trunk/tests/parser/utility-expected.gidl Tue Mar 11 23:22:55 2008
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<api version="1.0">
+ <namespace name="utility">
+ <struct name="UtilityObject">
+ <field name="parent_instance" type="GObject"/>
+ </struct>
+ <struct name="UtilityObjectClass">
+ <field name="parent_class" type="GObjectClass"/>
+ </struct>
+ </namespace>
+</api>
Added: trunk/tests/parser/utility.c
==============================================================================
--- (empty file)
+++ trunk/tests/parser/utility.c Tue Mar 11 23:22:55 2008
@@ -0,0 +1,16 @@
+#include "utility.h"
+
+G_DEFINE_TYPE (UtilityObject, utility_object, G_TYPE_OBJECT);
+
+static void
+utility_object_class_init (UtilityObjectClass *klass)
+{
+
+}
+
+static void
+utility_object_init (UtilityObject *object)
+{
+
+}
+
Added: trunk/tests/parser/utility.h
==============================================================================
--- (empty file)
+++ trunk/tests/parser/utility.h Tue Mar 11 23:22:55 2008
@@ -0,0 +1,23 @@
+#ifndef __UTILITY_H__
+#define __UTILITY_H__
+
+#include <glib-object.h>
+
+#define UTILITY_TYPE_OBJECT (utility_object_get_type ())
+#define UTILITY_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), UTILITY_TYPE_OBJECT, UtilityObject))
+#define UTILITY_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), UTILITY_TYPE_OBJECT))
+
+typedef struct _UtilityObject UtilityObject;
+typedef struct _UtilityObjectClass UtilityObjectClass;
+
+struct _UtilityObject
+{
+ GObject parent_instance;
+};
+
+struct _UtilityObjectClass
+{
+ GObjectClass parent_class;
+};
+
+#endif /* __UTILITY_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]