build: Allow to run the tests from any directory
[profile/ivi/clutter.git] / tests / conform / Makefile.am
1 include $(top_srcdir)/build/autotools/Makefile.am.silent
2
3 NULL =
4
5 noinst_PROGRAMS = test-conformance
6
7 test_conformance_SOURCES =              \
8         test-conform-main.c             \
9         test-conform-common.c           \
10         test-conform-common.h           \
11         \
12         test-timeline-interpolate.c     \
13         test-timeline-rewind.c          \
14         test-timeline.c                 \
15         test-cogl-vertex-buffer-contiguous.c \
16         test-cogl-vertex-buffer-interleved.c \
17         test-cogl-vertex-buffer-mutability.c \
18         test-cogl-fixed.c               \
19         test-cogl-backface-culling.c    \
20         test-cogl-npot-texture.c        \
21         test-cogl-blend-strings.c       \
22         test-cogl-premult.c             \
23         test-cogl-materials.c           \
24         test-cogl-viewport.c            \
25         test-cogl-offscreen.c           \
26         test-cogl-readpixels.c          \
27         test-cogl-multitexture.c        \
28         test-cogl-texture-mipmaps.c     \
29         test-cogl-texture-rectangle.c   \
30         test-cogl-texture-pixmap-x11.c  \
31         test-cogl-wrap-modes.c          \
32         test-cogl-pixel-buffer.c        \
33         test-cogl-path.c                \
34         test-cogl-object.c              \
35         test-cogl-depth-test.c          \
36         test-path.c                     \
37         test-pick.c                     \
38         test-clutter-rectangle.c        \
39         test-actor-invariants.c         \
40         test-paint-opacity.c            \
41         test-binding-pool.c             \
42         test-clutter-text.c             \
43         test-clutter-cairo-texture.c    \
44         test-text-cache.c               \
45         test-anchors.c                  \
46         test-model.c                    \
47         test-color.c                    \
48         test-clutter-units.c            \
49         test-group.c                    \
50         test-actor-size.c               \
51         test-texture-fbo.c              \
52         test-cogl-sub-texture.c         \
53         test-script-parser.c            \
54         test-actor-destroy.c            \
55         test-behaviours.c               \
56         test-animator.c                 \
57         test-state.c                    \
58         test-clutter-texture.c          \
59         $(NULL)
60
61 # For convenience, this provides a way to easily run individual unit tests:
62 .PHONY: wrappers clean-wrappers
63
64 UNIT_TESTS = `./test-conformance -l -m thorough | $(GREP) '^/'`
65
66 wrappers: stamp-test-conformance
67         @true
68 stamp-test-conformance: test-conformance$(EXEEXT)
69         @mkdir -p wrappers
70         @chmod +x test-launcher.sh
71         @for i in $(UNIT_TESTS); \
72         do \
73                 unit=`basename $$i | sed -e s/_/-/g`; \
74                 echo "  GEN    $$unit"; \
75                 ( echo "#!/bin/sh" ; echo "$(abs_builddir)/test-launcher.sh '$$i' \"\$$@\"" ) > $$unit$(EXEEXT) ; \
76                 ( echo "#!/bin/sh" ; echo "exec ./test-conformance$(EXEEXT) -p $$i \"\$$@\"" ) > wrappers/$$unit$(EXEEXT) ; \
77                 chmod +x $$unit$(EXEEXT); \
78                 chmod +x wrappers/$$unit$(EXEEXT); \
79         done \
80         && echo timestamp > $(@F)
81
82 clean-wrappers:
83         @for i in $(UNIT_TESTS); \
84         do \
85                 unit=`basename $$i | sed -e s/_/-/g`; \
86                 echo "  RM     $$unit"; \
87                 rm -f $$unit$(EXEEXT) ; \
88                 rm -f wrappers/$$unit$(EXEEXT) ; \
89         done \
90         && rm -f stamp-test-conformance
91
92 # NB: BUILT_SOURCES here a misnomer. We aren't building source, just inserting
93 # a phony rule that will generate symlink scripts for running individual tests
94 BUILT_SOURCES = wrappers
95
96 INCLUDES = \
97         -I$(top_srcdir)/ \
98         -I$(top_srcdir)/clutter \
99         -I$(top_srcdir)/clutter/cogl \
100         -I$(top_builddir)/clutter \
101         -I$(top_builddir)/clutter/cogl
102
103 test_conformance_CPPFLAGS = \
104         -DG_DISABLE_SINGLE_INCLUDES \
105         -DCOGL_ENABLE_EXPERIMENTAL_API \
106         -DCOGL_DISABLE_DEPRECATED \
107         -DCLUTTER_DISABLE_DEPRECATED \
108         -DTESTS_DATADIR=\""$(top_srcdir)/tests/data"\"
109
110 test_conformance_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
111
112 test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
113
114 test_conformance_LDFLAGS = -export-dynamic
115
116 .PHONY: test
117 .PHONY: test-report test-report-normal test-report-disable-npots
118 .PHONY: full-report full-report-normal full-report-disable-npots
119 .PHONY: full-report-generate
120
121 test: wrappers
122         @$(top_srcdir)/tests/conform/run-tests.sh \
123           ./test-conformance$(EXEEXT) test-conformance-results.xml
124
125 test-verbose: wrappers
126         @$(top_srcdir)/tests/conform/run-tests.sh \
127           ./test-conformance$(EXEEXT) test-conformance-results.xml --verbose
128
129 test-report-normal: wrappers
130         @$(top_srcdir)/tests/conform/run-tests.sh \
131           ./test-conformance$(EXEEXT) test-conformance-results.xml -k \
132           && ( gtester-report test-conformance-results.xml \
133               | sed 's/>GTester Unit Test Report</>GTester Unit Test Report (normal)</' \
134               > test-conformance-results.html ) \
135           && gnome-open ./test-conformance-results.html
136
137 test-report-disable-npots: wrappers
138         @../tools/disable-npots.sh \
139           $(top_srcdir)/tests/conform/run-tests.sh \
140             ./test-conformance$(EXEEXT) test-conformance-results-dn.xml -k \
141           && ( gtester-report test-conformance-results-dn.xml \
142               | sed 's/>GTester Unit Test Report</>GTester Unit Test Report (no NPOTs)</' \
143               > test-conformance-results-dn.html ) \
144           && gnome-open ./test-conformance-results-dn.html
145
146 test-report: test-report-normal
147
148 full-report-normal: wrappers
149         @$(top_srcdir)/tests/conform/run-tests.sh \
150           ./test-conformance$(EXEEXT) test-conformance-results.xml -k -m=slow \
151           && ( gtester-report test-conformance-results.xml \
152               | sed 's/>GTester Unit Test Report</>GTester Unit Test Report (normal)</' \
153               > test-conformance-results.html )
154
155 full-report-disable-npots: wrappers
156         @../tools/disable-npots.sh \
157           $(top_srcdir)/tests/conform/run-tests.sh \
158             ./test-conformance$(EXEEXT) test-conformance-results-dn.xml -k -m=slow \
159           && ( gtester-report test-conformance-results-dn.xml \
160               | sed 's/>GTester Unit Test Report</>GTester Unit Test Report (no NPOTs)</' \
161               > test-conformance-results-dn.html )
162
163 XML_REPORTS = test-conformance-results.xml
164 HTML_REPORTS = test-conformance-results.html
165
166 if HAVE_LIBDL
167 XML_REPORTS += test-conformance-results-dn.xml
168 HTML_REPORTS += test-conformance-results-dn.html
169 full-report-generate: full-report-normal full-report-disable-npots
170
171 else
172 full-report-generate: full-report-normal
173
174 endif
175
176 full-report: full-report-generate
177         @for x in $(HTML_REPORTS); do \
178                 gnome-open "$$x"; \
179         done
180
181 EXTRA_DIST = ADDING_NEW_TESTS test-launcher.sh.in run-tests.sh
182 DISTCLEANFILES = test-launcher.sh
183
184 # we override the clean-generic target to clean up the wrappers so
185 # we cannot use CLEANFILES
186 clean-generic: clean-wrappers
187         $(QUIET_RM)rm -f $(XML_REPORTS) $(HTML_REPORTS)