Imported Upstream version 3.1.92
[platform/upstream/pygobject2.git] / tests / Makefile.am
1 CLEANFILES =
2 noinst_LTLIBRARIES = libregress.la libgimarshallingtests.la
3
4 nodist_libregress_la_SOURCES = $(GI_DATADIR)/tests/regress.c $(GI_DATADIR)/tests/regress.h
5 libregress_la_CFLAGS = $(GIO_CFLAGS) $(PYCAIRO_CFLAGS)
6 libregress_la_LDFLAGS = -module -avoid-version $(GIO_LIBS) $(PYCAIRO_LIBS)
7 nodist_libgimarshallingtests_la_SOURCES = $(GI_DATADIR)/tests/gimarshallingtests.c $(GI_DATADIR)/tests/gimarshallingtests.h
8 libgimarshallingtests_la_CFLAGS = $(GLIB_CFLAGS)
9 libgimarshallingtests_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS)
10
11 # This is a hack to make sure a shared library is built
12 libregress.la: $(libregress_la_OBJECTS) $(libregress_la_DEPENDENCIES)
13         $(LINK) -rpath $(pkgpyexecdir) $(libregress_la_LDFLAGS) $(libregress_la_OBJECTS) $(libregress_la_LIBADD) $(LIBS)
14
15 libgimarshallingtests.la: $(libgimarshallingtests_la_OBJECTS) $(libgimarshallingtests_la_DEPENDENCIES)
16         $(LINK) -rpath $(pkgpyexecdir) $(libgimarshallingtests_la_LDFLAGS) $(libgimarshallingtests_la_OBJECTS) $(libgimarhallingtests_la_LIBADD) $(LIBS)
17
18 # g-i doesn't ship these as shared libraries anymore; we build them here
19 Regress-1.0.gir: libregress.la Makefile
20         $(AM_V_GEN) g-ir-scanner --include=cairo-1.0 --include=Gio-2.0 \
21         --namespace=Regress --nsversion=1.0 \
22         --warn-all --warn-error \
23         --library=libregress.la \
24         --libtool="$(top_builddir)/libtool" \
25         --output $@ \
26         $(nodist_libregress_la_SOURCES)
27 Regress-1.0.typelib: Regress-1.0.gir Makefile
28         $(AM_V_GEN) g-ir-compiler $< -o $@
29
30 GIMarshallingTests-1.0.gir: libgimarshallingtests.la Makefile
31         $(AM_V_GEN) g-ir-scanner --include=Gio-2.0 \
32         --namespace=GIMarshallingTests --nsversion=1.0 --symbol-prefix=gi_marshalling_tests \
33         --warn-all --warn-error \
34         --library=libgimarshallingtests.la \
35         --libtool="$(top_builddir)/libtool" \
36         --output $@ \
37         $(nodist_libgimarshallingtests_la_SOURCES)
38 GIMarshallingTests-1.0.typelib: GIMarshallingTests-1.0.gir Makefile
39         $(AM_V_GEN) g-ir-compiler $< -o $@
40
41 gschemas.compiled: org.gnome.test.gschema.xml
42         glib-compile-schemas --targetdir=. --schema-file=$<
43
44 CLEANFILES += Regress-1.0.gir Regress-1.0.typelib GIMarshallingTests-1.0.gir GIMarshallingTests-1.0.typelib gschemas.compiled
45
46 noinst_LTLIBRARIES += testhelper.la
47
48 testhelper_la_CFLAGS = -I$(top_srcdir)/gi/_gobject -I$(top_srcdir)/gi/_glib $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
49 testhelper_la_LDFLAGS = -module -avoid-version
50 testhelper_la_LIBADD = $(GLIB_LIBS)
51 testhelper_la_SOURCES = \
52         testhelpermodule.c \
53         test-floating.c \
54         test-thread.c \
55         test-unknown.c
56
57 # This is a hack to make sure a shared library is built
58 testhelper.la: $(testhelper_la_OBJECTS) $(testhelper_la_DEPENDENCIES)
59         $(LINK) -rpath $(pkgpyexecdir) $(testhelper_la_LDFLAGS) $(testhelper_la_OBJECTS) $(testhelper_la_LIBADD) $(LIBS)
60
61
62 .la.so:
63         test -L $@ || $(LN_S) .libs/$@ $@
64
65
66 all: $(LTLIBRARIES:.la=.so)
67
68 TEST_FILES_STATIC = \
69         test_gobject.py \
70         test_interface.py \
71         test_mainloop.py \
72         test_option.py \
73         test_properties.py \
74         test_signal.py \
75         test_source.py \
76         test_subprocess.py \
77         test_thread.py \
78         test_uris.py
79
80
81 TEST_FILES_GI = \
82         test_everything.py \
83         test_gi.py \
84         test_gdbus.py \
85         test_overrides.py \
86         test_pygtkcompat.py
87
88 EXTRA_DIST = \
89         compathelper.py \
90         runtests.py \
91         runtests-windows.py \
92         testmodule.py \
93         test-floating.h \
94         test-thread.h \
95         test-unknown.h \
96         te_ST@nouppera \
97         org.gnome.test.gschema.xml
98
99 EXTRA_DIST += $(TEST_FILES_STATIC) $(TEST_FILES_GI)
100
101 clean-local:
102         rm -f $(LTLIBRARIES:.la=.so) file.txt~
103
104 DBUS_LAUNCH=$(shell which dbus-launch)
105 RUN_TESTS_ENV_VARS= \
106         PYTHONPATH=$(top_builddir):$(top_builddir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \
107         LD_LIBRARY_PATH=$(builddir)/.libs:$$LD_LIBRARY_PATH \
108         GI_TYPELIB_PATH=$(builddir):$$GI_TYPELIB_PATH \
109         XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share \
110         TESTS_BUILDDIR=$(builddir)
111 RUN_TESTS_LAUNCH=$(RUN_TESTS_ENV_VARS) $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py
112
113 check-local: $(LTLIBRARIES:.la=.so) Regress-1.0.typelib GIMarshallingTests-1.0.typelib gschemas.compiled
114         TEST_FILES="$(TEST_FILES_STATIC)" $(RUN_TESTS_LAUNCH)
115         TEST_FILES="$(TEST_FILES_GI)" $(RUN_TESTS_LAUNCH)
116
117 check.gdb:
118         EXEC_NAME="gdb --args" $(MAKE) check
119
120 check.valgrind:
121         EXEC_NAME="valgrind --suppressions=python.supp" G_SLICE=always-malloc G_DEBUG=gc-friendly $(MAKE) check
122
123 -include $(top_srcdir)/git.mk