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