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