Revert "clutter.modules: Remove deps on gir-repository"
[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-3d.c          \
31         test-cogl-texture-pixmap-x11.c  \
32         test-cogl-texture-get-set-data.c \
33         test-cogl-wrap-modes.c          \
34         test-cogl-pixel-buffer.c        \
35         test-cogl-path.c                \
36         test-cogl-object.c              \
37         test-cogl-depth-test.c          \
38         test-path.c                     \
39         test-pick.c                     \
40         test-clutter-rectangle.c        \
41         test-actor-invariants.c         \
42         test-paint-opacity.c            \
43         test-binding-pool.c             \
44         test-clutter-text.c             \
45         test-clutter-cairo-texture.c    \
46         test-text-cache.c               \
47         test-anchors.c                  \
48         test-model.c                    \
49         test-color.c                    \
50         test-clutter-units.c            \
51         test-group.c                    \
52         test-actor-size.c               \
53         test-texture-fbo.c              \
54         test-cogl-sub-texture.c         \
55         test-script-parser.c            \
56         test-actor-destroy.c            \
57         test-behaviours.c               \
58         test-animator.c                 \
59         test-state.c                    \
60         test-clutter-texture.c          \
61         test-score.c                    \
62         $(NULL)
63
64 # For convenience, this provides a way to easily run individual unit tests:
65 .PHONY: wrappers clean-wrappers
66
67 UNIT_TESTS = `./test-conformance -l -m thorough | $(GREP) '^/'`
68
69 wrappers: stamp-test-conformance
70         @true
71 stamp-test-conformance: test-conformance$(EXEEXT)
72         @mkdir -p wrappers
73         @chmod +x test-launcher.sh
74         @for i in $(UNIT_TESTS); \
75         do \
76                 unit=`basename $$i | sed -e s/_/-/g`; \
77                 echo "  GEN    $$unit"; \
78                 ( echo "#!/bin/sh" ; echo "$(abs_builddir)/test-launcher.sh '$$i' \"\$$@\"" ) > $$unit$(EXEEXT) ; \
79                 ( echo "#!/bin/sh" ; echo "exec ./test-conformance$(EXEEXT) -p $$i \"\$$@\"" ) > wrappers/$$unit$(EXEEXT) ; \
80                 chmod +x $$unit$(EXEEXT); \
81                 chmod +x wrappers/$$unit$(EXEEXT); \
82         done \
83         && echo timestamp > $(@F)
84
85 clean-wrappers:
86         @for i in $(UNIT_TESTS); \
87         do \
88                 unit=`basename $$i | sed -e s/_/-/g`; \
89                 echo "  RM     $$unit"; \
90                 rm -f $$unit$(EXEEXT) ; \
91                 rm -f wrappers/$$unit$(EXEEXT) ; \
92         done \
93         && rm -f stamp-test-conformance
94
95 # NB: BUILT_SOURCES here a misnomer. We aren't building source, just inserting
96 # a phony rule that will generate symlink scripts for running individual tests
97 BUILT_SOURCES = wrappers
98
99 INCLUDES = \
100         -I$(top_srcdir)/ \
101         -I$(top_srcdir)/clutter \
102         -I$(top_srcdir)/clutter/cogl \
103         -I$(top_builddir)/clutter \
104         -I$(top_builddir)/clutter/cogl
105
106 test_conformance_CPPFLAGS = \
107         -DG_DISABLE_SINGLE_INCLUDES \
108         -DCOGL_ENABLE_EXPERIMENTAL_API \
109         -DCOGL_DISABLE_DEPRECATED \
110         -DCLUTTER_DISABLE_DEPRECATED \
111         -DTESTS_DATADIR=\""$(top_srcdir)/tests/data"\"
112
113 test_conformance_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
114
115 test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
116
117 test_conformance_LDFLAGS = -export-dynamic
118
119 test: wrappers
120         @$(top_srcdir)/tests/conform/run-tests.sh \
121           ./test-conformance$(EXEEXT) -o test-report.xml
122
123 test-verbose: wrappers
124         @$(top_srcdir)/tests/conform/run-tests.sh \
125           ./test-conformance$(EXEEXT) -o test-report.xml --verbose
126
127 GTESTER = gtester
128 GTESTER_REPORT = gtester-report
129
130 # XXX: we could prevent the conformance test suite from running
131 #      by simply defining this variable conditionally
132 TEST_PROGS = test-conformance
133
134 .PHONY: test
135 .PHONY: test-report perf-report full-report
136 .PHONY: test-report-npot perf-report-npot full-report-npot
137
138 # test-report: run tests and generate report
139 # perf-report: run tests with -m perf and generate report
140 # full-report: like test-report: with -m perf and -m slow
141 test-report perf-report full-report:    ${TEST_PROGS}
142         @test -z "${TEST_PROGS}" || { \
143           export GTESTER_LOGDIR=`mktemp -d "$(srcdir)/.testlogs-XXXXXX"` ; \
144           case $@ in \
145           test-report) test_options="-k";; \
146           perf-report) test_options="-k -m=perf";; \
147           full-report) test_options="-k -m=perf -m=slow";; \
148           esac ; \
149           $(top_srcdir)/tests/conform/run-tests.sh \
150             ./test-conformance$(EXEEXT) \
151             --verbose \
152             $$test_options \
153             -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ; \
154           echo '<?xml version="1.0"?>'            > $@.xml ; \
155           echo '<report-collection>'             >> $@.xml ; \
156           echo '<info>'                          >> $@.xml ; \
157           echo '  <package>$(PACKAGE)</package>' >> $@.xml ; \
158           echo '  <version>$(VERSION)</version>' >> $@.xml ; \
159           echo '</info>'                         >> $@.xml ; \
160           for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
161             sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
162           done ; \
163           echo >> $@.xml ; \
164           echo '</report-collection>' >> $@.xml ; \
165           ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
166           rm -rf "$$GTESTER_LOGDIR" ; \
167         }
168
169 # same as above, but with a wrapper that forcibly disables non-power of
170 # two textures
171 test-report-npot perf-report-npot full-report-npot:     ${TEST_PROGS}
172         @test -z "${TEST_PROGS}" || { \
173           $(top_srcdir)/tests/tools/disable-npots.sh ; \
174           export GTESTER_LOGDIR=`mktemp -d "$(srcdir)/.testlogs-XXXXXX"` ; \
175           case $@ in \
176           test-report-npot) test_options="-k";; \
177           perf-report-npot) test_options="-k -m=perf";; \
178           full-report-npot) test_options="-k -m=perf -m=slow";; \
179           esac ; \
180           $(top_srcdir)/tests/conform/run-tests.sh \
181             ./test-conformance$(EXEEXT) \
182             --verbose \
183             $$test_options \
184             -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ; \
185           echo '<?xml version="1.0"?>'            > $@.xml ; \
186           echo '<report-collection>'             >> $@.xml ; \
187           echo '<info>'                          >> $@.xml ; \
188           echo '  <package>$(PACKAGE)</package>' >> $@.xml ; \
189           echo '  <version>$(VERSION)</version>' >> $@.xml ; \
190           echo '</info>'                         >> $@.xml ; \
191           for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
192             sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
193           done ; \
194           echo >> $@.xml ; \
195           echo '</report-collection>' >> $@.xml ; \
196           ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
197           rm -rf "$$GTESTER_LOGDIR" ; \
198         }
199
200 XML_REPORTS = \
201         test-report.xml         \
202         perf-report.xml         \
203         full-report.xml         \
204         test-report-npot.xml    \
205         perf-report-npot.xml    \
206         full-report-npot.xml
207
208 HTML_REPORTS = \
209         test-report.html        \
210         perf-report.html        \
211         full-report.html        \
212         test-report-npot.html   \
213         perf-report-npot.html   \
214         full-report-npot.html
215
216 EXTRA_DIST = ADDING_NEW_TESTS test-launcher.sh.in run-tests.sh
217 DISTCLEANFILES = test-launcher.sh
218
219 # we override the clean-generic target to clean up the wrappers so
220 # we cannot use CLEANFILES
221 clean-generic: clean-wrappers
222         $(QUIET_RM)rm -f $(XML_REPORTS) $(HTML_REPORTS)