Imported Upstream version 3.13.92
[platform/upstream/pygobject2.git] / tests / Makefile.am
1 CLEANFILES =
2 check_LTLIBRARIES = libgimarshallingtests.la
3 test_typelibs = GIMarshallingTests-1.0.typelib
4
5 nodist_libgimarshallingtests_la_SOURCES = $(GI_DATADIR)/tests/gimarshallingtests.c $(GI_DATADIR)/tests/gimarshallingtests.h
6 libgimarshallingtests_la_CFLAGS = $(GLIB_CFLAGS)
7 libgimarshallingtests_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) -no-undefined
8
9 # This is a hack to make sure a shared library is built
10 libgimarshallingtests.la: $(libgimarshallingtests_la_OBJECTS) $(libgimarshallingtests_la_DEPENDENCIES)
11         $(AM_V_GEN) $(LINK) -rpath $(pkgpyexecdir) $(libgimarshallingtests_la_LDFLAGS) $(libgimarshallingtests_la_OBJECTS) $(libgimarhallingtests_la_LIBADD) $(LIBS)
12
13 GIMarshallingTests-1.0.gir: libgimarshallingtests.la Makefile
14         $(AM_V_GEN) g-ir-scanner --include=Gio-2.0 \
15         --namespace=GIMarshallingTests --nsversion=1.0 --symbol-prefix=gi_marshalling_tests \
16         --warn-all --warn-error \
17         --library=libgimarshallingtests.la \
18         --libtool="$(top_builddir)/libtool" \
19         --output $@ \
20         $(nodist_libgimarshallingtests_la_SOURCES)
21 GIMarshallingTests-1.0.typelib: GIMarshallingTests-1.0.gir Makefile
22         $(AM_V_GEN) g-ir-compiler $< -o $@
23
24 # regress.c needs cairo
25 if ENABLE_CAIRO
26 check_LTLIBRARIES += libregress.la
27 test_typelibs += Regress-1.0.typelib
28 nodist_libregress_la_SOURCES = $(GI_DATADIR)/tests/regress.c $(GI_DATADIR)/tests/regress.h
29 libregress_la_CFLAGS = $(GIO_CFLAGS) $(CAIRO_CFLAGS)
30 libregress_la_LDFLAGS = -module -avoid-version $(GIO_LIBS) $(CAIRO_LIBS) -no-undefined
31
32 libregress.la: $(libregress_la_OBJECTS) $(libregress_la_DEPENDENCIES)
33         $(AM_V_GEN) $(LINK) -rpath $(pkgpyexecdir) $(libregress_la_LDFLAGS) $(libregress_la_OBJECTS) $(libregress_la_LIBADD) $(LIBS)
34
35 # g-i doesn't ship these as shared libraries anymore; we build them here
36 Regress-1.0.gir: libregress.la Makefile
37         $(AM_V_GEN) g-ir-scanner --include=cairo-1.0 --include=Gio-2.0 \
38         --namespace=Regress --nsversion=1.0 \
39         --warn-all --warn-error \
40         --library=libregress.la \
41         --libtool="$(top_builddir)/libtool" \
42         --output $@ \
43         $(nodist_libregress_la_SOURCES)
44 Regress-1.0.typelib: Regress-1.0.gir Makefile
45         $(AM_V_GEN) g-ir-compiler $< -o $@
46
47 endif # ENABLE_CAIRO
48
49
50 gschemas.compiled: org.gnome.test.gschema.xml
51         glib-compile-schemas --targetdir=. --schema-file=$<
52
53 CLEANFILES += Regress-1.0.gir Regress-1.0.typelib GIMarshallingTests-1.0.gir GIMarshallingTests-1.0.typelib gschemas.compiled
54
55 check_LTLIBRARIES += testhelper.la
56
57 testhelper_la_CFLAGS = -I$(top_srcdir)/gi $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
58 testhelper_la_LDFLAGS = -module -avoid-version -no-undefined $(PYTHON_LIBS)
59 testhelper_la_LIBADD = $(GLIB_LIBS)
60 testhelper_la_SOURCES = \
61         testhelpermodule.c \
62         test-floating.c \
63         test-thread.c \
64         test-unknown.c
65
66 # This is a hack to make sure a shared library is built
67 testhelper.la: $(testhelper_la_OBJECTS) $(testhelper_la_DEPENDENCIES)
68         $(AM_V_GEN) $(LINK) -rpath $(pkgpyexecdir) $(testhelper_la_LDFLAGS) $(testhelper_la_OBJECTS) $(testhelper_la_LIBADD) $(LIBS)
69
70
71 .la.$(OS_EXT):
72         test -L $@ || $(LN_S) .libs/$@ $@
73
74
75 all: $(check_LTLIBRARIES:.la=.$(OS_EXT))
76
77 EXTRA_DIST = \
78         compathelper.py \
79         runtests.py \
80         runtests-windows.py \
81         testmodule.py \
82         test-floating.h \
83         test-thread.h \
84         test-unknown.h \
85         te_ST@nouppera \
86         org.gnome.test.gschema.xml \
87         test_cairo.py \
88         test_error.py \
89         test_gio.py \
90         test_glib.py \
91         test_gobject.py \
92         test_gtype.py \
93         test_interface.py \
94         test_internal_api.py \
95         test_iochannel.py \
96         test_mainloop.py \
97         test_object_marshaling.py \
98         test_option.py \
99         test_properties.py \
100         test_signal.py \
101         test_source.py \
102         test_subprocess.py \
103         test_thread.py \
104         test_typeclass.py \
105         test_everything.py \
106         test_gi.py \
107         test_gdbus.py \
108         test_import_machinery.py \
109         test_overrides_glib.py \
110         test_overrides_pango.py \
111         test_overrides_gdk.py \
112         test_overrides_gtk.py \
113         test_atoms.py \
114         test_generictreemodel.py \
115         test_docstring.py \
116         test_repository.py \
117         compat_test_pygtk.py \
118         gi/__init__.py \
119         gi/overrides/__init__.py \
120         gi/overrides/Regress.py \
121         $(NULL)
122
123 clean-local:
124         rm -f $(check_LTLIBRARIES:.la=.$(OS_EXT)) file.txt~
125
126 DBUS_LAUNCH=$(shell which dbus-launch)
127 RUN_TESTS_ENV_VARS= \
128         PYTHONPATH=$(top_builddir):$(top_builddir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \
129         LD_LIBRARY_PATH=$(builddir)/.libs:$$LD_LIBRARY_PATH \
130         GI_TYPELIB_PATH=$(builddir):$$GI_TYPELIB_PATH \
131         XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share \
132         MALLOC_PERTURB_=85 \
133         MALLOC_CHECK_=3 \
134         G_SLICE=debug-blocks \
135         TESTS_BUILDDIR=$(builddir)
136
137 # pygtkcompat tests need to be run in a separate process as they
138 # clobber global name space
139 check-local: $(check_LTLIBRARIES:.la=.$(OS_EXT)) $(test_typelibs) gschemas.compiled
140         export `$(DBUS_LAUNCH)` && \
141         $(RUN_TESTS_ENV_VARS) $(EXEC_NAME) $(PYTHON) -Wd $(srcdir)/runtests.py; rc=$$?; \
142         [ "$$rc" -ne 0 ] || [ -n "$$TEST_NAMES" ] || { TEST_NAMES=compat_test_pygtk $(RUN_TESTS_ENV_VARS) $(EXEC_NAME) $(PYTHON) -Wd -Werror::PendingDeprecationWarning -Werror::DeprecationWarning -Werror::RuntimeWarning $(srcdir)/runtests.py; rc=$$?; }; \
143         kill $$DBUS_SESSION_BUS_PID; \
144         exit $$rc
145
146 check.gdb:
147         EXEC_NAME="gdb --args" $(MAKE) check
148
149 check.nemiver:
150         EXEC_NAME="nemiver" $(MAKE) check
151
152 # Note G_SLICE in these check variations is intended to clobber the default set in RUN_TESTS_ENV_VARS
153 check.valgrind:
154         EXEC_NAME="G_SLICE=always-malloc G_DEBUG=gc-friendly \
155         valgrind --leak-check=full --show-possibly-lost=no --num-callers=20 \
156         --suppressions=$(top_srcdir)/tests/$(PYTHON_BASENAME).supp \
157         " \
158         $(MAKE) check
159
160 check.valgrindlog:
161         mkdir -p $(top_builddir)/tmp
162         EXEC_NAME="G_SLICE=always-malloc G_DEBUG=gc-friendly \
163         valgrind --leak-check=full --show-possibly-lost=no --num-callers=20 \
164         --suppressions=$(top_srcdir)/tests/$(PYTHON_BASENAME).supp \
165         --child-silent-after-fork=yes \
166         --log-file=$(top_builddir)/tmp/`git rev-parse HEAD | cut -c1-8`-$$TEST_NAMES.log \
167         " \
168         $(MAKE) check
169
170 check.valgrindxml:
171         mkdir -p $(top_builddir)/tmp
172         EXEC_NAME="G_SLICE=always-malloc G_DEBUG=gc-friendly \
173         valgrind --leak-check=full --show-possibly-lost=no --num-callers=20 \
174         --suppressions=$(top_srcdir)/tests/$(PYTHON_BASENAME).supp \
175         --child-silent-after-fork=yes \
176         --xml=yes --xml-file=$(top_builddir)/tmp/`git rev-parse HEAD | cut -c1-8`-$$TEST_NAMES.xml \
177         " \
178         $(MAKE) check