conform: Make gtester run a list of wrappers
[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-wrap-modes.c          \
31         test-cogl-pixel-buffer.c        \
32         test-cogl-path.c                \
33         test-path.c                     \
34         test-pick.c                     \
35         test-clutter-rectangle.c        \
36         test-actor-invariants.c         \
37         test-paint-opacity.c            \
38         test-binding-pool.c             \
39         test-clutter-text.c             \
40         test-text-cache.c               \
41         test-anchors.c                  \
42         test-model.c                    \
43         test-color.c                    \
44         test-clutter-units.c            \
45         test-group.c                    \
46         test-actor-size.c               \
47         test-texture-fbo.c              \
48         test-cogl-sub-texture.c         \
49         test-script-parser.c            \
50         test-actor-destroy.c            \
51         test-behaviours.c               \
52         test-animator.c                 \
53         $(NULL)
54
55 # For convenience, this provides a way to easily run individual unit tests:
56 .PHONY: wrappers clean-wrappers
57
58 UNIT_TESTS = `./test-conformance -l -m thorough | $(GREP) '^/'`
59
60 wrappers: stamp-test-conformance
61         @true
62 stamp-test-conformance: test-conformance$(EXEEXT)
63         @mkdir -p wrappers
64         @for i in $(UNIT_TESTS); \
65         do \
66                 unit=`basename $$i | sed -e s/_/-/g`; \
67                 echo "  GEN    $$unit"; \
68                 ( echo "#!/bin/sh" ; echo "$(top_srcdir)/tests/conform/test-launcher.sh '$$i' \"\$$@\"" ) > $$unit$(EXEEXT) ; \
69                 ( echo "#!/bin/sh" ; echo "exec ./test-conformance$(EXEEXT) -p $$i \"\$$@\"" ) > wrappers/$$unit$(EXEEXT) ; \
70                 chmod +x $$unit$(EXEEXT); \
71                 chmod +x wrappers/$$unit$(EXEEXT); \
72         done \
73         && echo timestamp > $(@F)
74
75 clean-wrappers:
76         @for i in $(UNIT_TESTS); \
77         do \
78                 unit=`basename $$i | sed -e s/_/-/g`; \
79                 echo "  RM     $$unit"; \
80                 rm -f $$unit$(EXEEXT) ; \
81                 rm -f wrappers/$$unit$(EXEEXT) ; \
82         done \
83         && rm -f stamp-test-conformance
84
85 # NB: BUILT_SOURCES here a misnomer. We aren't building source, just inserting
86 # a phony rule that will generate symlink scripts for running individual tests
87 BUILT_SOURCES = wrappers
88
89 INCLUDES = \
90         -I$(top_srcdir)/ \
91         -I$(top_srcdir)/clutter \
92         -I$(top_srcdir)/clutter/cogl \
93         -I$(top_builddir)/clutter \
94         -I$(top_builddir)/clutter/cogl
95
96 test_conformance_CPPFLAGS = \
97         -DG_DISABLE_SINGLE_INCLUDES \
98         -DCOGL_ENABLE_EXPERIMENTAL_API \
99         -DCOGL_DISABLE_DEPRECATED \
100         -DCLUTTER_DISABLE_DEPRECATED \
101         -DTESTS_DATADIR=\""$(top_srcdir)/tests/data"\"
102
103 test_conformance_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
104
105 test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
106
107 test_conformance_LDFLAGS = -rdynamic
108
109 .PHONY: test
110 .PHONY: test-report test-report-normal test-report-disable-npots
111 .PHONY: full-report full-report-normal full-report-disable-npots
112 .PHONY: full-report-generate
113
114 test: wrappers
115         @$(top_srcdir)/tests/conform/run-tests.sh \
116           ./test-conformance$(EXEEXT) test-conformance-results.xml
117
118 test-verbose: wrappers
119         @$(top_srcdir)/tests/conform/run-tests.sh \
120           ./test-conformance$(EXEEXT) test-conformance-results.xml --verbose
121
122 test-report-normal: wrappers
123         @$(top_srcdir)/tests/conform/run-tests.sh \
124           ./test-conformance$(EXEEXT) test-conformance-results.xml -k \
125           && ( gtester-report test-conformance-results.xml \
126               | sed 's/>GTester Unit Test Report</>GTester Unit Test Report (normal)</' \
127               > test-conformance-results.html ) \
128           && gnome-open ./test-conformance-results.html
129
130 test-report-disable-npots: wrappers
131         @../tools/disable-npots.sh \
132           $(top_srcdir)/tests/conform/run-tests.sh \
133             ./test-conformance$(EXEEXT) test-conformance-results-dn.xml -k \
134           && ( gtester-report test-conformance-results-dn.xml \
135               | sed 's/>GTester Unit Test Report</>GTester Unit Test Report (no NPOTs)</' \
136               > test-conformance-results-dn.html ) \
137           && gnome-open ./test-conformance-results-dn.html
138
139 test-report: test-report-normal
140
141 full-report-normal: wrappers
142         @$(top_srcdir)/tests/conform/run-tests.sh \
143           ./test-conformance$(EXEEXT) test-conformance-results.xml -k -m=slow \
144           && ( gtester-report test-conformance-results.xml \
145               | sed 's/>GTester Unit Test Report</>GTester Unit Test Report (normal)</' \
146               > test-conformance-results.html )
147
148 full-report-disable-npots: wrappers
149         @../tools/disable-npots.sh \
150           $(top_srcdir)/tests/conform/run-tests.sh \
151             ./test-conformance$(EXEEXT) test-conformance-results-dn.xml -k -m=slow \
152           && ( gtester-report test-conformance-results-dn.xml \
153               | sed 's/>GTester Unit Test Report</>GTester Unit Test Report (no NPOTs)</' \
154               > test-conformance-results-dn.html )
155
156 XML_REPORTS = test-conformance-results.xml
157 HTML_REPORTS = test-conformance-results.html
158
159 if HAVE_LIBDL
160 XML_REPORTS += test-conformance-results-dn.xml
161 HTML_REPORTS += test-conformance-results-dn.html
162 full-report-generate: full-report-normal full-report-disable-npots
163
164 else
165 full-report-generate: full-report-normal
166
167 endif
168
169 full-report: full-report-generate
170         @for x in $(HTML_REPORTS); do \
171                 gnome-open "$$x"; \
172         done
173
174 EXTRA_DIST = ADDING_NEW_TESTS test-launcher.sh run-tests.sh
175
176 # we override the clean-generic target to clean up the wrappers so
177 # we cannot use CLEANFILES
178 clean-generic: clean-wrappers
179         $(QUIET_RM)rm -f $(XML_REPORTS) $(HTML_REPORTS)