1UNIT_TESTS = \
2	test-texture-slicing.c \
3	test-texture-async.c \
4	test-texture-material.c \
5	test-events.c \
6	test-scale.c \
7        test-actors.c \
8	test-shader-effects.c \
9	test-script.c \
10	test-grab.c \
11	test-cogl-shader-arbfp.c \
12	test-cogl-shader-glsl.c \
13	test-animator.c \
14	test-state.c \
15	test-state-animator.c \
16	test-fbo.c \
17	test-multistage.c \
18	test-cogl-tex-tile.c \
19	test-cogl-tex-convert.c \
20	test-cogl-tex-foreign.c \
21	test-cogl-offscreen.c \
22	test-cogl-tex-polygon.c \
23	test-cogl-multitexture.c \
24	test-stage-read-pixels.c \
25	test-paint-wrapper.c \
26	test-texture-quality.c \
27	test-layout.c \
28        test-animation.c \
29        test-easing.c \
30        test-binding-pool.c \
31        test-text.c \
32        test-text-field.c \
33	test-cairo-clock.c \
34	test-cairo-flowers.c \
35	test-cogl-vertex-buffer.c \
36	test-stage-sizing.c \
37	test-scrolling.c \
38	test-swipe-action.c \
39	test-cogl-point-sprites.c \
40	test-table-layout.c \
41	test-path-constraint.c \
42	test-state-script.c \
43	test-devices.c \
44	test-content.c \
45	test-keyframe-transition.c \
46	test-bind-constraint.c \
47	test-touch-events.c \
48	test-rotate-zoom.c
49
50if X11_TESTS
51UNIT_TESTS += test-pixmap.c
52endif
53
54if PIXBUF_TESTS
55UNIT_TESTS += \
56	test-image.c
57endif
58
59SHEXT = $(EXEEXT)
60
61# For convenience, this provides a way to easily run individual unit tests:
62wrappers: stamp-test-interactive
63	@true
64
65GIT_IGNORE_EXTRA = \
66	stamp-test-interactive \
67	stamp-test-unit-names \
68	test-unit-names.h \
69	$(UNIT_TESTS:.c=$(SHEXT))
70
71stamp-test-interactive: Makefile
72	@wrapper=$(abs_builddir)/wrapper.sh ; \
73	chmod +x $$wrapper && \
74	for i in $(UNIT_TESTS); \
75	do \
76		test_bin=$${i%*.c} ; \
77		echo "  GEN      $$test_bin" ; \
78		( echo "#!/bin/sh" ; \
79		  echo "$$wrapper $$test_bin \$$@" \
80		) > $$test_bin$(SHEXT) ; \
81		chmod +x $$test_bin$(SHEXT) ; \
82	done \
83	&& echo timestamp > $(@F)
84
85test-unit-names.h: stamp-test-unit-names
86	@true
87
88stamp-test-unit-names: Makefile
89	@( echo "/* ** This file is autogenerated. Do not edit. ** */" ; \
90	  echo "" ; \
91	  echo "const char *test_unit_names[] = {" ) > test-unit-names.h ; \
92	for i in $(UNIT_TESTS); \
93	do \
94		test_bin=$${i%*.c} ; \
95		echo "  \"$$test_bin\"," >> test-unit-names.h ; \
96	done \
97	&& echo "};" >> test-unit-names.h \
98	&& echo timestamp > $(@F)
99
100clean-wrappers:
101	@for i in $(UNIT_TESTS); \
102	do \
103		test_bin=$${i%*.c} ; \
104		echo "  RM      $$test_bin"; \
105		rm -f $$test_bin$(SHEXT); \
106	done \
107	&& rm -f stamp-test-unit-names \
108	&& rm -f stamp-test-interactive
109
110.PHONY: wrappers clean-wrappers
111
112common_ldadd = \
113  $(top_builddir)/clutter/libmuffin-clutter-@MUFFIN_PLUGIN_API_VERSION@.la \
114  $(top_builddir)/../cogl/cogl/libmuffin-cogl-@MUFFIN_PLUGIN_API_VERSION@.la
115
116check_PROGRAMS = test-interactive
117check_SCRIPTS = wrappers
118
119test_interactive_SOURCES = test-main.c $(UNIT_TESTS)
120nodist_test_interactive_SOURCES = test-unit-names.h
121test_interactive_CFLAGS = $(CLUTTER_CFLAGS) $(GDK_PIXBUF_CFLAGS)
122test_interactive_CPPFLAGS = \
123	-DTESTS_DATADIR=\""$(abs_srcdir)"\" \
124	-DG_DISABLE_SINGLE_INCLUDES \
125	-DGLIB_DISABLE_DEPRECATION_WARNINGS \
126	-DCOGL_DISABLE_DEPRECATION_WARNINGS \
127	-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
128	-I$(top_srcdir)/../cogl                 \
129	-I$(top_builddir)/../cogl               \
130	-I$(top_builddir)/../cogl/cogl          \
131	-I$(top_srcdir)	\
132	-I$(top_builddir) \
133	-I$(top_srcdir)/clutter \
134	-I$(top_builddir)/clutter
135test_interactive_LDFLAGS = -export-dynamic
136test_interactive_LDADD = $(CLUTTER_LIBS) $(GDK_PIXBUF_LIBS) $(common_ldadd) $(LIBM)
137
138EXTRA_DIST = \
139	wrapper.sh.in \
140	test-script.json \
141	test-script-signals.json \
142	redhand.png
143
144DISTCLEANFILES = wrapper.sh .gitignore test-unit-names.h
145
146BUILT_SOURCES = test-unit-names.h
147
148clean-local: clean-wrappers
149