[gobject-introspection] tests: Export the Symbols from the Offsets Tests
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] tests: Export the Symbols from the Offsets Tests
- Date: Wed, 3 Sep 2014 01:36:50 +0000 (UTC)
commit 5143afb1e79f4a67f57499ca60f6df3a4682eb21
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Aug 25 11:21:05 2014 +0800
tests: Export the Symbols from the Offsets Tests
Like the other test programs, include config.h before anything and decorate
the lone symbols for export, and include $(top_srcdir)/tests so that
gitestmacros.h can be found and used.
https://bugzilla.gnome.org/show_bug.cgi?id=732669
build/gi-tests-msvc.mak | 4 ++--
tests/offsets/Makefile.am | 6 +++---
tests/offsets/offsets.c | 3 +++
tests/offsets/offsets.h | 2 ++
4 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/build/gi-tests-msvc.mak b/build/gi-tests-msvc.mak
index 9a22d46..bc958a4 100644
--- a/build/gi-tests-msvc.mak
+++ b/build/gi-tests-msvc.mak
@@ -97,7 +97,7 @@ barapp.exe:
@-if exist $ manifest @mt /manifest $ manifest /outputresource:$@;1
gitestoffsets.exe: gitestoffsets.c
- $(CC) $(CFLAGS) /I..\girepository /I..\tests\offsets $*.c $(LDFLAGS) girepository-$(GI_APIVERSION).lib
+ $(CC) $(CFLAGS) /I..\girepository /I..\tests\offsets /I..\tests $*.c $(LDFLAGS)
girepository-$(GI_APIVERSION).lib
@-if exist $ manifest @mt /manifest $ manifest /outputresource:$@;1
@set GI_TYPELIB_PATH=.
@-$@ offsets.compiled offsets.introspected
@@ -124,7 +124,7 @@ Everything-$(GI_APIVERSION).gir: everything.dll
Offsets-$(GI_APIVERSION).gir: offsets.dll
$(PYTHON2) $(G_IR_SCANNER_CURRENT) --warn-all --warn-error --reparse-validate \
--namespace=Offsets --nsversion=$(GI_APIVERSION) \
- --no-libtool -I.. -I..\tests\offsets \
+ --no-libtool -I.. -I..\tests\offsets -I..\tests \
--pkg=gobject-$(GLIB_APIVERSION) --add-include-path=. --include=GObject-$(GLIB_APIVERSION) \
--library=$* --output=$@ \
..\tests\offsets\offsets.h ..\tests\offsets\offsets.c
diff --git a/tests/offsets/Makefile.am b/tests/offsets/Makefile.am
index 9608ad0..65d8773 100644
--- a/tests/offsets/Makefile.am
+++ b/tests/offsets/Makefile.am
@@ -16,7 +16,7 @@ EXTRA_LTLIBRARIES += liboffsets.la
liboffsets_la_SOURCES = \
offsets.h \
offsets.c
-liboffsets_la_CPPFLAGS = $(GIREPO_CFLAGS) $(GI_HIDDEN_VISIBILITY_CFLAGS)
+liboffsets_la_CPPFLAGS = $(GIREPO_CFLAGS) $(GI_HIDDEN_VISIBILITY_CFLAGS) -I$(top_srcdir)/tests
# dummy rpath to get built dynamically (huh?)
liboffsets_la_LDFLAGS = -avoid-version -rpath $(libdir)
@@ -25,7 +25,7 @@ Offsets_1_0_gir_INCLUDES = GObject-2.0
Offsets_1_0_gir_LIBS = liboffsets.la
Offsets_1_0_gir_PACKAGES = gobject-2.0
Offsets_1_0_gir_FILES = $(srcdir)/offsets.h $(srcdir)/offsets.c
-Offsets_1_0_gir_SCANNERFLAGS = --warn-all --warn-error
+Offsets_1_0_gir_SCANNERFLAGS = --warn-all --warn-error -I$(top_srcdir)/tests
INTROSPECTION_GIRS += Offsets-1.0.gir
CLEANFILES += Offsets-1.0.gir Offsets-1.0.typelib liboffsets.la
@@ -35,7 +35,7 @@ CLEANFILES += Offsets-1.0.gir Offsets-1.0.typelib liboffsets.la
EXTRA_PROGRAMS += gitestoffsets
nodist_gitestoffsets_SOURCES = gitestoffsets.c
-gitestoffsets_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
+gitestoffsets_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository -I$(top_srcdir)/tests
gitestoffsets_LDADD = $(top_builddir)/libgirepository-1.0.la $(GIREPO_LIBS)
gitestoffsets.c: gen-gitestoffsets offsets.h Offsets-1.0.typelib
diff --git a/tests/offsets/offsets.c b/tests/offsets/offsets.c
index bd009e8..d8a280e 100644
--- a/tests/offsets/offsets.c
+++ b/tests/offsets/offsets.c
@@ -1,5 +1,8 @@
+#include "config.h"
+
#include <offsets.h>
+_GI_TEST_EXTERN
void offsets_dummy(void);
/* To avoid an empty compilation unit */
diff --git a/tests/offsets/offsets.h b/tests/offsets/offsets.h
index 7bdc1ad..b57b1bf 100644
--- a/tests/offsets/offsets.h
+++ b/tests/offsets/offsets.h
@@ -5,6 +5,8 @@
#include <glib-object.h>
#include <time.h>
+#include "gitestmacros.h"
+
/* Test we get the alignment right for various basic types; we put
* a char in front of of each field to make it more likely that we'll
* stress out the alignment code.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]