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