summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorColin Walters <walters@src.gnome.org>2008-10-18 00:44:19 +0000
committerColin Walters <walters@src.gnome.org>2008-10-18 00:44:19 +0000
commita17e0d1dcd24d1f6d6316f2d8065f25b77254669 (patch)
treecc68fa43d4ae7031c4a9a094363ea4ad1238c46a /tests
parentddba2d15b1d4dbe66fac09fb62e3d0b023492cf4 (diff)
downloadgobject-introspection-a17e0d1dcd24d1f6d6316f2d8065f25b77254669.tar.gz
Add GtkFrob test that mirrors GtkSource
svn path=/trunk/; revision=747
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/GtkFrob-1.0-expected.gir16
-rw-r--r--tests/scanner/Makefile.am18
-rw-r--r--tests/scanner/gtkfrob.c6
-rw-r--r--tests/scanner/gtkfrob.h11
4 files changed, 50 insertions, 1 deletions
diff --git a/tests/scanner/GtkFrob-1.0-expected.gir b/tests/scanner/GtkFrob-1.0-expected.gir
new file mode 100644
index 00000000..8d7c3329
--- /dev/null
+++ b/tests/scanner/GtkFrob-1.0-expected.gir
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<repository version="1.0"
+ xmlns="http://www.gtk.org/introspection/core/1.0"
+ xmlns:c="http://www.gtk.org/introspection/c/1.0"
+ xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+ <include name="GLib" version="2.0"/>
+ <include name="GObject" version="2.0"/>
+ <namespace name="GtkFrob" version="1.0" shared-library="gtkfrob">
+ <function name="language_manager_get_default"
+ c:identifier="gtk_frob_language_manager_get_default">
+ <return-value>
+ <type name="none" c:type="void"/>
+ </return-value>
+ </function>
+ </namespace>
+</repository>
diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am
index 019feae2..820b0893 100644
--- a/tests/scanner/Makefile.am
+++ b/tests/scanner/Makefile.am
@@ -4,7 +4,8 @@ testlib_LTLIBRARIES = \
libannotation.la \
libdrawable.la \
libfoo.la \
- libutility.la
+ libutility.la \
+ libgtkfrob.la
testlibdir = $(prefix)/unused
install-testlibLTLIBRARIES: # prevent it from being installed
@@ -16,6 +17,7 @@ libannotation_la_SOURCES = $(srcdir)/annotation.c $(srcdir)/annotation.h
libdrawable_la_SOURCES = $(srcdir)/drawable.c $(srcdir)/drawable.h
libfoo_la_SOURCES = $(srcdir)/foo.c $(srcdir)/foo.h
libutility_la_SOURCES = $(srcdir)/utility.c $(srcdir)/utility.h
+libgtkfrob_la_SOURCES = $(srcdir)/gtkfrob.c $(srcdir)/gtkfrob.h
if OS_WIN32
AM_LDFLAGS += -no-undefined
@@ -89,6 +91,20 @@ utility-1.0.gir: libutility.la utility.h $(SCANNER) $(SCANNER_LIBS) Makefile
--output $@
GIRS += utility-1.0.gir
+# This one tests different --namespace and --strip-prefix
+GtkFrob-1.0.gir: libgtkfrob.la gtkfrob.h $(SCANNER) $(SCANNER_LIBS) Makefile
+ PYTHONPATH=$(top_builddir):$$PYTHONPATH $(CHECK_DEBUG) $(SCANNER) -v \
+ --add-include-path=$(top_builddir)/gir --add-include-path=. \
+ --include=GObject-2.0 \
+ --library=gtkfrob \
+ --namespace=GtkFrob \
+ --strip-prefix=Gtk \
+ --nsversion=1.0 \
+ --pkg gobject-2.0 \
+ $(libgtkfrob_la_SOURCES) \
+ --output $@
+GIRS += GtkFrob-1.0.gir
+
pre-check:
@if test "$(top_builddir)" != "$(top_srcdir)"; then \
cp -f $(top_srcdir)/giscanner/*.py $(top_builddir)/giscanner; \
diff --git a/tests/scanner/gtkfrob.c b/tests/scanner/gtkfrob.c
new file mode 100644
index 00000000..eb1977ab
--- /dev/null
+++ b/tests/scanner/gtkfrob.c
@@ -0,0 +1,6 @@
+#include "gtkfrob.h"
+
+void
+gtk_frob_language_manager_get_default ()
+{
+}
diff --git a/tests/scanner/gtkfrob.h b/tests/scanner/gtkfrob.h
new file mode 100644
index 00000000..8d7bf337
--- /dev/null
+++ b/tests/scanner/gtkfrob.h
@@ -0,0 +1,11 @@
+#ifndef __UTILITY_H__
+#define __UTILITY_H__
+
+#include <glib-object.h>
+
+
+/* A global function */
+
+void gtk_frob_language_manager_get_default ();
+
+#endif /* __UTILITY_H__ */