Some error handling/reporting fixes.
[pygobject.git] / tests / Makefile.am
blob9d5db5e0c62cc7724a24984e3bbe40699836ce35
1 CLEANFILES =
2 check_LTLIBRARIES = libgimarshallingtests.la
3 test_typelibs = GIMarshallingTests-1.0.typelib
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
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)
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 $@
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
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)
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 $@
47 endif # ENABLE_CAIRO
50 gschemas.compiled: org.gnome.test.gschema.xml
51         glib-compile-schemas --targetdir=. --schema-file=$<
53 CLEANFILES += Regress-1.0.gir Regress-1.0.typelib GIMarshallingTests-1.0.gir GIMarshallingTests-1.0.typelib gschemas.compiled
55 check_LTLIBRARIES += testhelper.la
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
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)
71 .la.$(OS_EXT):
72         test -L $@ || $(LN_S) .libs/$@ $@
75 all: $(check_LTLIBRARIES:.la=.$(OS_EXT))
77 EXTRA_DIST = \
78         helper.py \
79         compathelper.py \
80         runtests.py \
81         runtests-windows.py \
82         testmodule.py \
83         test-floating.h \
84         test-thread.h \
85         test-unknown.h \
86         te_ST@nouppera \
87         org.gnome.test.gschema.xml \
88         test_cairo.py \
89         test_error.py \
90         test_fields.py \
91         test_gio.py \
92         test_glib.py \
93         test_gobject.py \
94         test_gtype.py \
95         test_interface.py \
96         test_internal_api.py \
97         test_iochannel.py \
98         test_mainloop.py \
99         test_object_marshaling.py \
100         test_option.py \
101         test_properties.py \
102         test_signal.py \
103         test_source.py \
104         test_subprocess.py \
105         test_thread.py \
106         test_typeclass.py \
107         test_everything.py \
108         test_gi.py \
109         test_gdbus.py \
110         test_import_machinery.py \
111         test_overrides_glib.py \
112         test_overrides_pango.py \
113         test_overrides_gdk.py \
114         test_overrides_gtk.py \
115         test_atoms.py \
116         test_generictreemodel.py \
117         test_docstring.py \
118         test_repository.py \
119         test_resulttuple.py \
120         compat_test_pygtk.py \
121         gi/__init__.py \
122         gi/overrides/__init__.py \
123         gi/overrides/Regress.py \
124         $(NULL)
126 clean-local:
127         rm -f $(check_LTLIBRARIES:.la=.$(OS_EXT)) file.txt~
129 DBUS_LAUNCH=$(shell which dbus-launch)
130 RUN_TESTS_ENV_VARS= \
131         PYTHONPATH=$(top_builddir):$(top_builddir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \
132         LD_LIBRARY_PATH=$(builddir)/.libs:$$LD_LIBRARY_PATH \
133         GI_TYPELIB_PATH=$(builddir):$$GI_TYPELIB_PATH \
134         XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share \
135         MALLOC_PERTURB_=85 \
136         MALLOC_CHECK_=3 \
137         G_SLICE=debug-blocks \
138         TESTS_BUILDDIR=$(builddir)
140 # pygtkcompat tests need to be run in a separate process as they
141 # clobber global name space
142 check-local: $(check_LTLIBRARIES:.la=.$(OS_EXT)) $(test_typelibs) gschemas.compiled
143         export `$(DBUS_LAUNCH)` && \
144         $(RUN_TESTS_ENV_VARS) $(EXEC_NAME) $(PYTHON) -Wd $(srcdir)/runtests.py; rc=$$?; \
145         [ "$$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=$$?; }; \
146         kill $$DBUS_SESSION_BUS_PID; \
147         exit $$rc
149 check.gdb:
150         EXEC_NAME="gdb --args" $(MAKE) check
152 check.nemiver:
153         EXEC_NAME="nemiver" $(MAKE) check
155 # Note G_SLICE in these check variations is intended to clobber the default set in RUN_TESTS_ENV_VARS
156 check.valgrind:
157         EXEC_NAME="G_SLICE=always-malloc G_DEBUG=gc-friendly \
158         valgrind --leak-check=full --show-possibly-lost=no --num-callers=20 \
159         --suppressions=$(top_srcdir)/tests/$(PYTHON_BASENAME).supp \
160         " \
161         $(MAKE) check
163 check.valgrindlog:
164         mkdir -p $(top_builddir)/tmp
165         EXEC_NAME="G_SLICE=always-malloc G_DEBUG=gc-friendly \
166         valgrind --leak-check=full --show-possibly-lost=no --num-callers=20 \
167         --suppressions=$(top_srcdir)/tests/$(PYTHON_BASENAME).supp \
168         --child-silent-after-fork=yes \
169         --log-file=$(top_builddir)/tmp/`git rev-parse HEAD | cut -c1-8`-$$TEST_NAMES.log \
170         " \
171         $(MAKE) check
173 check.valgrindxml:
174         mkdir -p $(top_builddir)/tmp
175         EXEC_NAME="G_SLICE=always-malloc G_DEBUG=gc-friendly \
176         valgrind --leak-check=full --show-possibly-lost=no --num-callers=20 \
177         --suppressions=$(top_srcdir)/tests/$(PYTHON_BASENAME).supp \
178         --child-silent-after-fork=yes \
179         --xml=yes --xml-file=$(top_builddir)/tmp/`git rev-parse HEAD | cut -c1-8`-$$TEST_NAMES.xml \
180         " \
181         $(MAKE) check