Merge branch 'master' into 0.11
[platform/upstream/gstreamer.git] / tests / check / Makefile.am
1 include $(top_srcdir)/common/check.mak
2
3 CHECK_REGISTRY = $(top_builddir)/tests/check/test-registry.reg
4
5 GST_TOOLS_DIR = $(top_builddir)/tools
6
7 REGISTRY_ENVIRONMENT = \
8         GST_REGISTRY=$(CHECK_REGISTRY)
9
10 TESTS_ENVIRONMENT = \
11         GST_STATE_IGNORE_ELEMENTS="$(STATE_IGNORE_ELEMENTS)"    \
12         $(REGISTRY_ENVIRONMENT)                                 \
13         GST_PLUGIN_SCANNER=$(top_builddir)/libs/gst/helpers/gst-plugin-scanner \
14         GST_PLUGIN_SYSTEM_PATH=                                 \
15         GST_PLUGIN_PATH=$(top_builddir)/plugins
16
17 plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
18
19 # override to _not_ install the test plugins
20 install-pluginLTLIBRARIES:
21
22 # the core dumps of some machines have PIDs appended, test registry and
23 # profiling data
24 CLEANFILES = core core.* test-registry.* *.gcno *.gcda
25
26 SUPPRESSIONS = $(top_srcdir)/common/gst.supp
27
28 clean-local: clean-local-check
29
30 if GST_DISABLE_PARSE
31 PARSE_CHECKS = pipelines/parse-disabled
32 else
33 PARSE_CHECKS = pipelines/simple-launch-lines pipelines/cleanup pipelines/parse-launch
34 endif
35
36 # Do not run the abi test in case any option which causes the API to change has
37 # been used
38 if FALSE
39 if !GST_DISABLE_REGISTRY
40 if !GST_DISABLE_TRACE
41 ABI_CHECKS = gst/gstabi
42 endif
43 endif
44 endif
45
46 if FALSE
47 LIBSABI_CHECKS = libs/libsabi
48 endif
49
50 if HAVE_CXX
51 CXX_CHECKS = gst/gstcpp libs/gstlibscpp
52 else
53 CXX_CHECKS =
54 endif
55
56 # if it's calling gst_element_factory_make(), it will probably not work without
57 # a registry
58 if GST_DISABLE_REGISTRY
59 REGISTRY_CHECKS =
60 else
61 REGISTRY_CHECKS =                               \
62         gst/gst                                 \
63         gst/gstbin                              \
64         gst/gstchildproxy                       \
65         gst/gstelement                          \
66         gst/gstelementfactory                   \
67         gst/gstevent                            \
68         gst/gstghostpad                         \
69         gst/gstindex                            \
70         gst/gstplugin                           \
71         gst/gstpreset                           \
72         gst/gstquery                            \
73         gst/gstregistry                         \
74         gst/gsturi                              \
75         gst/gstutils                            \
76         generic/sinks                           \
77         elements/capsfilter                     \
78         elements/fakesink                       \
79         elements/fakesrc                        \
80         elements/fdsrc                          \
81         elements/filesink                       \
82         elements/filesrc                        \
83         elements/funnel                         \
84         elements/identity                       \
85         elements/multiqueue                     \
86         elements/selector                       \
87         elements/tee                            \
88         elements/queue                          \
89         elements/queue2                         \
90         elements/valve                          \
91         libs/basesrc                            \
92         libs/basesink                           \
93         libs/controller                         \
94         libs/typefindhelper                     \
95         pipelines/stress                        \
96         pipelines/queue-error
97 endif
98
99 check_PROGRAMS =                                \
100         $(ABI_CHECKS)                           \
101         gst/gstatomicqueue                      \
102         gst/gstbuffer                           \
103         gst/gstbufferlist                       \
104         gst/gstmeta                             \
105         gst/gstbus                              \
106         gst/gstcaps                             \
107         $(CXX_CHECKS)                           \
108         gst/gstdatetime                         \
109         gst/gstinfo                             \
110         gst/gstiterator                         \
111         gst/gstmessage                          \
112         gst/gstminiobject                       \
113         gst/gstobject                           \
114         gst/gstpad                              \
115         gst/gstparamspecs                       \
116         gst/gstpoll                             \
117         gst/gstsegment                          \
118         gst/gstsystemclock                      \
119         gst/gstclock                            \
120         gst/gststructure                        \
121         gst/gsttag                              \
122         gst/gsttagsetter                        \
123         gst/gsttask                             \
124         gst/gstvalue                            \
125         generic/states                          \
126         $(PARSE_CHECKS)                         \
127         $(REGISTRY_CHECKS)                      \
128         $(LIBSABI_CHECKS)                       \
129         libs/gdp                                \
130         libs/adapter                            \
131         libs/bitreader                          \
132         libs/bytereader                         \
133         libs/bytewriter                         \
134         libs/gstnetclientclock                  \
135         libs/gstnettimeprovider                 \
136         libs/transform1
137
138 # failing tests
139 noinst_PROGRAMS =                               \
140         gst/gstpipeline                         \
141         libs/collectpads
142
143 # elements to ignore for the state tests
144 # STATE_IGNORE_ELEMENTS =
145
146 TESTS = $(check_PROGRAMS)
147
148 noinst_HEADERS = \
149         gst/capslist.h \
150         gst/struct_arm.h \
151         gst/struct_i386.h \
152         gst/struct_hppa.h \
153         gst/struct_ppc32.h \
154         gst/struct_ppc64.h \
155         gst/struct_sparc.h \
156         gst/struct_x86_64.h \
157         libs/struct_arm.h \
158         libs/struct_i386.h \
159         libs/struct_hppa.h \
160         libs/struct_ppc32.h \
161         libs/struct_ppc64.h \
162         libs/struct_sparc.h \
163         libs/struct_x86_64.h
164
165 EXTRA_DIST = \
166         libs/test_transform.c
167
168 AM_CFLAGS = $(GST_OBJ_CFLAGS) -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS
169 AM_CXXFLAGS = $(GST_OBJ_CXXFLAGS) -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS
170 LDADD = $(top_builddir)/libs/gst/check/libgstcheck-@GST_MAJORMINOR@.la \
171         $(top_builddir)/libs/gst/base/libgstbase-@GST_MAJORMINOR@.la \
172         $(GST_OBJ_LIBS)
173
174 gst_gstcpp_SOURCES = gst/gstcpp.cc
175
176 libs_gstlibscpp_SOURCES = libs/gstlibscpp.cc
177
178 gst_gstutils_LDADD = $(LDADD) $(GSL_LIBS) $(GMP_LIBS)
179
180 libs_gdp_SOURCES = \
181         libs/gdp.c
182 libs_gdp_LDADD = \
183         $(top_builddir)/libs/gst/dataprotocol/libgstdataprotocol-@GST_MAJORMINOR@.la \
184         $(LDADD)
185
186 elements_fdsrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \
187         -DTESTFILE=\"$(top_srcdir)/configure.ac\"
188 elements_filesrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \
189         -DTESTFILE=\"$(top_srcdir)/configure.ac\"
190
191 libs_controller_LDADD = \
192         $(top_builddir)/libs/gst/controller/libgstcontroller-@GST_MAJORMINOR@.la \
193         $(LDADD)
194 libs_gstnetclientclock_LDADD = \
195         $(top_builddir)/libs/gst/net/libgstnet-@GST_MAJORMINOR@.la \
196         $(LDADD)
197 libs_gstnettimeprovider_LDADD = \
198         $(top_builddir)/libs/gst/net/libgstnet-@GST_MAJORMINOR@.la \
199         $(LDADD)
200
201 # valgrind testing
202 # these just need valgrind fixing, period
203 VALGRIND_TO_FIX = \
204         gst/gstinfo \
205         libs/collectpads \
206         pipelines/parse-launch
207
208 VALGRIND_IGNORE = \
209         pipelines/stress
210
211 # these need fixing because the threads cause segfaults under valgrind
212 TESTS_THREADED =                                \
213         gst/gstminiobject                       \
214         gst/gstobject
215
216 VALGRIND_TESTS_DISABLE =                                        \
217         $(TESTS_THREADED)                                       \
218         $(VALGRIND_IGNORE)                                      \
219         $(VALGRIND_TO_FIX)
220
221 # indexers does not get tested yet
222 COVERAGE_DIRS = \
223         gst \
224         libs/gst/base \
225         libs/gst/controller \
226         libs/gst/check \
227         libs/gst/dataprotocol \
228         libs/gst/net \
229         plugins/elements
230 COVERAGE_FILES = $(foreach dir,$(COVERAGE_DIRS),$(wildcard $(top_builddir)/$(dir)/*.gcov))
231 COVERAGE_FILES_REL = $(subst $(top_builddir)/,,$(COVERAGE_FILES))
232 COVERAGE_OUT_FILES = $(foreach dir,$(COVERAGE_DIRS),$(wildcard $(top_builddir)/$(dir)/*.gcov.out))
233 COVERAGE_OUT_FILES_REL = $(subst $(top_builddir)/,,$(COVERAGE_OUT_FILES))
234
235 debug:
236         echo $(COVERAGE_FILES)
237         echo $(COVERAGE_FILES_REL)
238
239 .PHONY: coverage
240 if GST_GCOV_ENABLED
241 # we rebuild a registry and do gst-inspect so that all the get/set codepaths
242 # are also covered
243 coverage:
244         for file in `find $(top_builddir) -name '*.gcda'`; do rm $$file; done
245         -rm $(CHECK_REGISTRY)
246         echo "Inspecting all elements"
247         for e in `$(GST_INSPECT) | head -n -2 | cut -d: -f2`; do $(GST_INSPECT) $$e > /dev/null 2>&1; done
248         make check
249         make coverage-report
250 else
251 coverage:
252         echo "You need to configure with --enable-gcov to get coverage data"
253         exit 1
254 endif
255
256 coverage-report:
257         rm -r coverage
258         for dir in $(COVERAGE_DIRS); do                                 \
259           mkdir -p coverage/$$dir;                                      \
260           make -C $(top_builddir)/$$dir gcov;                           \
261         done
262         for dir in $(COVERAGE_DIRS); do                                 \
263             files="`ls $(top_builddir)/$$dir/*.gcov.out 2> /dev/null`"; \
264           if test ! -z "$$files"; then                                  \
265             perl $(top_srcdir)/common/coverage/coverage-report.pl       \
266               $(top_builddir)/$$dir/*.gcov.out >                        \
267               coverage/$$dir/index.xml;                                 \
268             xsltproc $(top_srcdir)/common/coverage/coverage-report.xsl  \
269               coverage/$$dir/index.xml > coverage/$$dir/index.html;     \
270           fi; \
271         done
272
273         for file in $(COVERAGE_FILES_REL); do                           \
274           echo Generating coverage/$$file.html;                         \
275           perl $(top_srcdir)/common/coverage/coverage-report-entry.pl   \
276             $(top_builddir)/$$file > coverage/$$file.html;              \
277         done