Imported Upstream version 2.26.0
[platform/upstream/pygobject2.git] / tests / Makefile.am
1 CLEANFILES =
2 noinst_LTLIBRARIES = 
3 if ENABLE_INTROSPECTION
4 noinst_LTLIBRARIES += libregress.la libgimarshallingtests.la
5
6 nodist_libregress_la_SOURCES = $(GI_DATADIR)/tests/regress.c $(GI_DATADIR)/tests/regress.h
7 libregress_la_CFLAGS = $(GIO_CFLAGS) $(PYCAIRO_CFLAGS)
8 libregress_la_LDFLAGS = -module -avoid-version $(GIO_LIBS) $(PYCAIRO_LIBS)
9 nodist_libgimarshallingtests_la_SOURCES = $(GI_DATADIR)/tests/gimarshallingtests.c $(GI_DATADIR)/tests/gimarshallingtests.h
10 libgimarshallingtests_la_CFLAGS = $(GLIB_CFLAGS)
11 libgimarshallingtests_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS)
12
13 # This is a hack to make sure a shared library is built
14 libregress.la: $(libregress_la_OBJECTS) $(libregress_la_DEPENDENCIES)
15         $(LINK) -rpath $(pkgpyexecdir) $(libregress_la_LDFLAGS) $(libregress_la_OBJECTS) $(libregress_la_LIBADD) $(LIBS)
16
17 libgimarshallingtests.la: $(libgimarshallingtests_la_OBJECTS) $(libgimarshallingtests_la_DEPENDENCIES)
18         $(LINK) -rpath $(pkgpyexecdir) $(libgimarshallingtests_la_LDFLAGS) $(libgimarshallingtests_la_OBJECTS) $(libgimarhallingtests_la_LIBADD) $(LIBS)
19
20 # g-i doesn't ship these as shared libraries anymore; we build them here
21 Regress-1.0.gir: libregress.la Makefile
22         $(AM_V_GEN) g-ir-scanner --include=cairo-1.0 --include=Gio-2.0 \
23         --namespace=Regress --nsversion=1.0 \
24         --warn-all --warn-error \
25         --library=libregress.la \
26         --libtool="$(top_builddir)/libtool" \
27         --output $@ \
28         $(nodist_libregress_la_SOURCES)
29 Regress-1.0.typelib: Regress-1.0.gir Makefile
30         $(AM_V_GEN) g-ir-compiler $< -o $@
31
32 GIMarshallingTests-1.0.gir: libgimarshallingtests.la Makefile
33         $(AM_V_GEN) g-ir-scanner --include=Gio-2.0 \
34         --namespace=GIMarshallingTests --nsversion=1.0 --symbol-prefix=gi_marshalling_tests \
35         --warn-all --warn-error \
36         --library=libgimarshallingtests.la \
37         --libtool="$(top_builddir)/libtool" \
38         --output $@ \
39         $(nodist_libgimarshallingtests_la_SOURCES)
40 GIMarshallingTests-1.0.typelib: GIMarshallingTests-1.0.gir Makefile
41         $(AM_V_GEN) g-ir-compiler $< -o $@
42
43 CLEANFILES += Regress-1.0.gir Regress-1.0.typelib GIMarshallingTests-1.0.gir GIMarshallingTests-1.0.typelib
44 endif
45
46 noinst_LTLIBRARIES += testhelper.la
47
48 testhelper_la_CFLAGS = -I$(top_srcdir)/gobject -I$(top_srcdir)/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 = \
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 if BUILD_GIO
81 TEST_FILES += \
82         test_gio.py \
83         test_gresolver.py \
84         test_gsocket.py \
85         test_gicon.py \
86         test_gcancellable.py
87 endif 
88
89 if ENABLE_INTROSPECTION
90 TEST_FILES += \
91         test_everything.py \
92         test_gi.py \
93         test_overrides.py
94 endif
95
96 EXTRA_DIST = \
97         compathelper.py \
98         runtests.py \
99         testmodule.py \
100         test-floating.h \
101         test-thread.h \
102         test-unknown.h 
103
104 EXTRA_DIST += $(TEST_FILES)
105
106 clean-local:
107         rm -f $(LTLIBRARIES:.la=.so) file.txt~
108
109
110 check-local: $(LTLIBRARIES:.la=.so) Regress-1.0.typelib GIMarshallingTests-1.0.typelib
111         TEST_FILES="$(TEST_FILES)" PYTHONPATH=$(top_builddir):$(top_builddir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} LD_LIBRARY_PATH=$(builddir)/.libs:$$LD_LIBRARY_PATH GI_TYPELIB_PATH=$(builddir) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py
112
113 check.gdb:
114         EXEC_NAME="gdb --args" $(MAKE) check
115
116 check.valgrind:
117         EXEC_NAME="valgrind" G_SLICE=always-malloc G_DEBUG=gc-friendly $(MAKE) check