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