summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorColin Walters <walters@src.gnome.org>2008-11-13 19:57:12 +0000
committerColin Walters <walters@src.gnome.org>2008-11-13 19:57:12 +0000
commitb76cca0eb5ea3363ef738b7c9b3d3e9eefea6b79 (patch)
treed11bbc4e4fcf7fbf927a2ac801f793dfcc9bbfed /tests
parentb1b589ab793633352be375e18f0b3a821ae70afe (diff)
downloadgobject-introspection-b76cca0eb5ea3363ef738b7c9b3d3e9eefea6b79.tar.gz
Bug 558436 - avoid having scanner load app code
svn path=/trunk/; revision=912
Diffstat (limited to 'tests')
-rw-r--r--tests/everything/Makefile.am11
-rw-r--r--tests/offsets/Makefile.am15
-rw-r--r--tests/scanner/Makefile.am60
-rw-r--r--tests/scanner/annotation-1.0-expected.gir2
-rw-r--r--tests/scanner/annotation-1.0-expected.tgir2
-rw-r--r--tests/scanner/annotation.c2
-rw-r--r--tests/scanner/annotation.h2
-rw-r--r--tests/scanner/foo-1.0-expected.gir2
-rw-r--r--tests/scanner/foo-1.0-expected.tgir2
9 files changed, 50 insertions, 48 deletions
diff --git a/tests/everything/Makefile.am b/tests/everything/Makefile.am
index 8f3eceb6..ec209d51 100644
--- a/tests/everything/Makefile.am
+++ b/tests/everything/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/common.mk
+
LT_CURRENT = 1
LT_REVISION = 0
LT_AGE = 0
@@ -23,18 +25,13 @@ AM_LDFLAGS += -no-undefined
endif
GIRS =
-SCANNER = $(top_srcdir)/tools/g-ir-scanner
-SCANNER_PYTHONPATH = $(top_builddir):$(top_srcdir):$$PYTHONPATH
-SCANNER_LIBS = $(top_srcdir)/giscanner/*.py \
- $(top_builddir)/giscanner/libgiscanner.la
TYPELIBS = $(GIRS:.gir=.typelib)
TXMLS = $(GIRS:.gir=.gir.txml)
CLEANFILES = $(TYPELIBS) $(TXMLS) $(GIRS)
BUILT_SOURCES = $(TYPELIBS) $(TXMLS) $(GIRS)
-Everything-$(TYPELIB_VERSION).gir: libgirepository-everything.la gitesttypes.c gitesttypes.h $(SCANNER) $(SCANNER_LIBS)
- PYTHONPATH=$(SCANNER_PYTHONPATH) $(CHECK_DEBUG) $(SCANNER) -v \
- --add-include-path=$(top_builddir)/gir \
+Everything-$(TYPELIB_VERSION).gir: libgirepository-everything.la gitesttypes.c gitesttypes.h $(SCANNER_BIN) $(SCANNER_LIBS)
+ $(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
--library=girepository-everything \
--namespace=Everything --nsversion=$(TYPELIB_VERSION) \
diff --git a/tests/offsets/Makefile.am b/tests/offsets/Makefile.am
index 57cfdfb7..2c3cae20 100644
--- a/tests/offsets/Makefile.am
+++ b/tests/offsets/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/common.mk
+
BUILT_SOURCES =
CLEANFILES =
EXTRA_DIST =
@@ -5,12 +7,6 @@ EXTRA_DIST =
check_LTLIBRARIES =
check_PROGRAMS =
-SCANNER = $(top_srcdir)/tools/g-ir-scanner
-SCANNER_PYTHONPATH = $(top_builddir):$(top_srcdir):$$PYTHONPATH
-SCANNER_LIBS = \
- $(top_srcdir)/giscanner/*.py \
- $(top_builddir)/giscanner/libgiscanner.la
-
############################################################
check_LTLIBRARIES += liboffsets.la
@@ -20,11 +16,10 @@ liboffsets_la_SOURCES = \
offsets.c
liboffsets_la_CPPFLAGS = $(GIREPO_CFLAGS)
# dummy rpath to get built dynamically (huh?)
-liboffsets_la_LDFLAGS = -module -avoid-version -rpath $(libdir)
+liboffsets_la_LDFLAGS = -avoid-version -rpath $(libdir)
-offsets-1.0.gir: liboffsets.la offsets.h $(SCANNER) $(SCANNER_LIBS) Makefile
- PYTHONPATH=$(SCANNER_PYTHONPATH) $(CHECK_DEBUG) $(SCANNER) -v \
- --add-include-path=$(top_builddir)/gir --add-include-path=. \
+offsets-1.0.gir: liboffsets.la offsets.h $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
+ $(CHECK_DEBUG) $(SCANNER) \
--library=offsets \
--namespace=offsets \
--nsversion=1.0 \
diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am
index 9fba3b0f..ae42ccea 100644
--- a/tests/scanner/Makefile.am
+++ b/tests/scanner/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/common.mk
+
# We need to build a shared library, which can be dlopened
# it does not work with noinst_LTLIBRARIES
testlib_LTLIBRARIES = \
@@ -9,9 +11,10 @@ testlib_LTLIBRARIES = \
testlibdir = $(prefix)/unused
install-testlibLTLIBRARIES: # prevent it from being installed
-AM_CFLAGS = $(GOBJECT_CFLAGS)
-AM_LDFLAGS = -module -avoid-version
-LIBS = $(GOBJECT_LIBS)
+AM_CPPFLAGS = -I$(top_srcdir)/girepository
+AM_CFLAGS = $(GOBJECT_CFLAGS) $(GTHREAD_CFLAGS)
+AM_LDFLAGS = -avoid-version
+LIBS = $(GOBJECT_LIBS) $(GTHREAD_LIBS)
libannotation_la_SOURCES = $(srcdir)/annotation.c $(srcdir)/annotation.h
libdrawable_la_SOURCES = $(srcdir)/drawable.c $(srcdir)/drawable.h
@@ -25,11 +28,6 @@ endif
# .gir --[scanner]-> .typelib --[generate]-> .tgir
GIRS =
-SCANNER = $(top_srcdir)/tools/g-ir-scanner
-SCANNER_PYTHONPATH = $(top_builddir):$(top_srcdir):$$PYTHONPATH
-SCANNER_LIBS = \
- $(top_srcdir)/giscanner/*.py \
- $(top_builddir)/giscanner/libgiscanner.la
TYPELIBS = $(GIRS:.gir=.typelib)
CHECKGIRS = $(GIRS:.gir=.gir.check)
EXPECTEDGIRS = $(GIRS:.gir=-expected.gir)
@@ -40,9 +38,8 @@ CLEANFILES = $(TYPELIBS) $(GIRS) $(TGIRS)
BUILT_SOURCES = $(TYPELIBS) $(GIRS)
EXTRA_DIST = $(EXPECTEDGIRS) $(EXPECTEDTGIRS)
-annotation-1.0.gir: libannotation.la annotation.c annotation.h utility-1.0.gir $(SCANNER) $(SCANNER_LIBS) Makefile
- PYTHONPATH=$(SCANNER_PYTHONPATH) $(CHECK_DEBUG) $(SCANNER) -v \
- --add-include-path=$(top_builddir)/gir --add-include-path=. \
+annotation-1.0.gir: libannotation.la annotation.c annotation.h utility-1.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
+ $(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
--include=utility-1.0 \
--library=annotation \
@@ -53,9 +50,8 @@ annotation-1.0.gir: libannotation.la annotation.c annotation.h utility-1.0.gir $
--output $@
GIRS += annotation-1.0.gir
-drawable-1.0.gir: libdrawable.la drawable.c drawable.h utility-1.0.gir $(SCANNER) $(SCANNER_LIBS) Makefile
- PYTHONPATH=$(SCANNER_PYTHONPATH) $(CHECK_DEBUG) $(SCANNER) -v \
- --add-include-path=$(top_builddir)/gir --add-include-path=. \
+drawable-1.0.gir: libdrawable.la drawable.c drawable.h utility-1.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
+ $(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
--include=utility-1.0 \
--library=drawable \
@@ -66,15 +62,14 @@ drawable-1.0.gir: libdrawable.la drawable.c drawable.h utility-1.0.gir $(SCANNER
--output $@
GIRS += drawable-1.0.gir
-drawable-injected-1.0.gir: drawable-1.0.gir $(SCANNER) $(SCANNER_LIBS) Makefile
- PYTHONPATH=$(SCANNER_PYTHONPATH) $(CHECK_DEBUG) $(SCANNER) -v \
+drawable-injected-1.0.gir: drawable-1.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
+ $(CHECK_DEBUG) $(SCANNER) -v \
--inject drawable-1.0.gir $(srcdir)/DrawableAdditions.xml $@
GIRS += drawable-injected-1.0.gir
EXTRA_DIST += DrawableAdditions.xml
-foo-1.0.gir: libfoo.la foo.c foo.h utility-1.0.gir $(SCANNER) $(SCANNER_LIBS) Makefile
- PYTHONPATH=$(SCANNER_PYTHONPATH) $(CHECK_DEBUG) $(SCANNER) -v \
- --add-include-path=$(top_builddir)/gir --add-include-path=. \
+foo-1.0.gir: libfoo.la foo.c foo.h utility-1.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
+ $(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
--include=utility-1.0 \
--library=foo \
@@ -85,9 +80,8 @@ foo-1.0.gir: libfoo.la foo.c foo.h utility-1.0.gir $(SCANNER) $(SCANNER_LIBS) Ma
--output $@
GIRS += foo-1.0.gir
-utility-1.0.gir: libutility.la utility.h $(SCANNER) $(SCANNER_LIBS) Makefile
- PYTHONPATH=$(SCANNER_PYTHONPATH) $(CHECK_DEBUG) $(SCANNER) -v \
- --add-include-path=$(top_builddir)/gir --add-include-path=. \
+utility-1.0.gir: libutility.la utility.h $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
+ $(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
--library=utility \
--namespace=utility \
@@ -98,9 +92,8 @@ utility-1.0.gir: libutility.la utility.h $(SCANNER) $(SCANNER_LIBS) Makefile
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=$(SCANNER_PYTHONPATH) $(CHECK_DEBUG) $(SCANNER) -v \
- --add-include-path=$(top_builddir)/gir --add-include-path=. \
+GtkFrob-1.0.gir: libgtkfrob.la gtkfrob.h $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
+ $(CHECK_DEBUG) $(SCANNER) \
--include=GObject-2.0 \
--library=gtkfrob \
--namespace=GtkFrob \
@@ -111,6 +104,23 @@ GtkFrob-1.0.gir: libgtkfrob.la gtkfrob.h $(SCANNER) $(SCANNER_LIBS) Makefile
--output $@
GIRS += GtkFrob-1.0.gir
+bin_PROGRAMS = barapp
+
+barapp_SOURCES = barapp.c barapp.h
+barapp_LDADD = $(top_builddir)/girepository/libgirepository.la
+barapp_LDFLAGS = -export-dynamic
+BarApp-1.0.gir: barapp $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
+ $(SCANNER) \
+ --include=GObject-2.0 \
+ --program=./barapp \
+ --namespace=BarApp \
+ --strip-prefix=Bar \
+ --nsversion=1.0 \
+ --pkg gobject-2.0 \
+ $(barapp_SOURCES) \
+ --output $@
+GIRS += BarApp-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/annotation-1.0-expected.gir b/tests/scanner/annotation-1.0-expected.gir
index 4f080dc0..1a859b3c 100644
--- a/tests/scanner/annotation-1.0-expected.gir
+++ b/tests/scanner/annotation-1.0-expected.gir
@@ -62,7 +62,7 @@
<type name="GObject.Object" c:type="GObject*"/>
</return-value>
<parameters>
- <parameter name="somearg" transfer-ownership="full" allow-none="1">
+ <parameter name="somearg" transfer-ownership="none" allow-none="1">
<type name="utf8" c:type="gchar*"/>
</parameter>
</parameters>
diff --git a/tests/scanner/annotation-1.0-expected.tgir b/tests/scanner/annotation-1.0-expected.tgir
index e6f3a18f..3a4067be 100644
--- a/tests/scanner/annotation-1.0-expected.tgir
+++ b/tests/scanner/annotation-1.0-expected.tgir
@@ -60,7 +60,7 @@
<type name="GObject.Object"/>
</return-value>
<parameters>
- <parameter name="somearg" transfer-ownership="full" allow-none="1">
+ <parameter name="somearg" transfer-ownership="none" allow-none="1">
<type name="utf8"/>
</parameter>
</parameters>
diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c
index bcfe55fa..ef521a23 100644
--- a/tests/scanner/annotation.c
+++ b/tests/scanner/annotation.c
@@ -247,7 +247,7 @@ annotation_object_compute_sum_n(AnnotationObject *object,
* @somearg: (allow-none):
**/
GObject*
-annotation_object_allow_none (AnnotationObject *object, gchar *somearg)
+annotation_object_allow_none (AnnotationObject *object, const gchar *somearg)
{
return NULL;
}
diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h
index ea78786a..3eb9fcb8 100644
--- a/tests/scanner/annotation.h
+++ b/tests/scanner/annotation.h
@@ -39,7 +39,7 @@ gint annotation_object_out (AnnotationObject *object,
int *outarg);
GObject* annotation_object_create_object(AnnotationObject *object);
GObject* annotation_object_allow_none (AnnotationObject *object,
- gchar *somearg);
+ const gchar *somearg);
GObject* annotation_object_notrans (AnnotationObject *object);
gint annotation_object_inout (AnnotationObject *object,
int *inoutarg);
diff --git a/tests/scanner/foo-1.0-expected.gir b/tests/scanner/foo-1.0-expected.gir
index d55bc8dd..312db61e 100644
--- a/tests/scanner/foo-1.0-expected.gir
+++ b/tests/scanner/foo-1.0-expected.gir
@@ -157,7 +157,7 @@
<type name="utf8" c:type="gchararray"/>
</return-value>
<parameters>
- <parameter name="object" transfer-ownership="full">
+ <parameter name="object" transfer-ownership="none">
<type name="GObject.Object" c:type="GObject"/>
</parameter>
<parameter name="p0" transfer-ownership="none">
diff --git a/tests/scanner/foo-1.0-expected.tgir b/tests/scanner/foo-1.0-expected.tgir
index d3e82e1a..5a457f89 100644
--- a/tests/scanner/foo-1.0-expected.tgir
+++ b/tests/scanner/foo-1.0-expected.tgir
@@ -101,7 +101,7 @@
<type name="utf8"/>
</return-value>
<parameters>
- <parameter name="object" transfer-ownership="full">
+ <parameter name="object" transfer-ownership="none">
<type name="GObject.Object"/>
</parameter>
<parameter name="p0" transfer-ownership="none">