Fix gap in Makefile
[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/stress                        \
99         pipelines/queue-error
100 endif
101
102 check_PROGRAMS =                                \
103         $(ABI_CHECKS)                           \
104         gst/gstatomicqueue                      \
105         gst/gstbuffer                           \
106         gst/gstbufferlist                       \
107         gst/gstmeta                             \
108         gst/gstmemory                           \
109         gst/gstbus                              \
110         gst/gstcaps                             \
111         $(CXX_CHECKS)                           \
112         gst/gstdatetime                         \
113         gst/gstinfo                             \
114         gst/gstiterator                         \
115         gst/gstmessage                          \
116         gst/gstminiobject                       \
117         gst/gstobject                           \
118         gst/gstpad                              \
119         gst/gstparamspecs                       \
120         gst/gstpoll                             \
121         gst/gstsegment                          \
122         gst/gstsystemclock                      \
123         gst/gstclock                            \
124         gst/gststructure                        \
125         gst/gsttag                              \
126         gst/gsttagsetter                        \
127         gst/gsttask                             \
128         gst/gstvalue                            \
129         generic/states                          \
130         $(PARSE_CHECKS)                         \
131         $(REGISTRY_CHECKS)                      \
132         $(LIBSABI_CHECKS)                       \
133         libs/adapter                            \
134         libs/bitreader                          \
135         libs/bytereader                         \
136         libs/bytewriter                         \
137         libs/gstnetclientclock                  \
138         libs/gstnettimeprovider                 \
139         libs/transform1
140
141 # failing tests
142 noinst_PROGRAMS =                               \
143         gst/gstpipeline                         \
144         libs/collectpads2
145
146 # elements to ignore for the state tests
147 # STATE_IGNORE_ELEMENTS =
148
149 TESTS = $(check_PROGRAMS)
150
151 noinst_HEADERS = \
152         gst/capslist.h \
153         gst/struct_arm.h \
154         gst/struct_i386.h \
155         gst/struct_hppa.h \
156         gst/struct_ppc32.h \
157         gst/struct_ppc64.h \
158         gst/struct_sparc.h \
159         gst/struct_x86_64.h \
160         libs/struct_arm.h \
161         libs/struct_i386.h \
162         libs/struct_hppa.h \
163         libs/struct_ppc32.h \
164         libs/struct_ppc64.h \
165         libs/struct_sparc.h \
166         libs/struct_x86_64.h
167
168 EXTRA_DIST = \
169         libs/test_transform.c
170
171 AM_CFLAGS = $(GST_OBJ_CFLAGS) -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS
172 AM_CXXFLAGS = $(GST_OBJ_CXXFLAGS) -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS
173 LDADD = $(top_builddir)/libs/gst/check/libgstcheck-@GST_MAJORMINOR@.la \
174         $(top_builddir)/libs/gst/base/libgstbase-@GST_MAJORMINOR@.la \
175         $(GST_OBJ_LIBS)
176
177 gst_gstcpp_SOURCES = gst/gstcpp.cc
178
179 libs_gstlibscpp_SOURCES = libs/gstlibscpp.cc
180
181 gst_gstutils_LDADD = $(LDADD) $(GSL_LIBS) $(GMP_LIBS)
182
183 elements_fdsrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \
184         -DTESTFILE=\"$(top_srcdir)/configure.ac\"
185 elements_filesrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \
186         -DTESTFILE=\"$(top_srcdir)/configure.ac\"
187
188 libs_controller_LDADD = \
189         $(top_builddir)/libs/gst/controller/libgstcontroller-@GST_MAJORMINOR@.la \
190         $(LDADD)
191 libs_gstnetclientclock_LDADD = \
192         $(top_builddir)/libs/gst/net/libgstnet-@GST_MAJORMINOR@.la \
193         $(LDADD)
194 libs_gstnettimeprovider_LDADD = \
195         $(top_builddir)/libs/gst/net/libgstnet-@GST_MAJORMINOR@.la \
196         $(GIO_LIBS) $(LDADD)
197
198 # valgrind testing
199 # these just need valgrind fixing, period
200 VALGRIND_TO_FIX = \
201         gst/gstinfo \
202         pipelines/parse-launch
203
204 VALGRIND_IGNORE = \
205         pipelines/stress
206
207 # these need fixing because the threads cause segfaults under valgrind
208 TESTS_THREADED =                                \
209         gst/gstminiobject                       \
210         gst/gstobject
211
212 VALGRIND_TESTS_DISABLE =                                        \
213         $(TESTS_THREADED)                                       \
214         $(VALGRIND_IGNORE)                                      \
215         $(VALGRIND_TO_FIX)
216
217 # indexers does not get tested yet
218 COVERAGE_DIRS = \
219         gst \
220         libs/gst/base \
221         libs/gst/controller \
222         libs/gst/check \
223         libs/gst/net \
224         plugins/elements
225 COVERAGE_FILES = $(foreach dir,$(COVERAGE_DIRS),$(wildcard $(top_builddir)/$(dir)/*.gcov))
226 COVERAGE_FILES_REL = $(subst $(top_builddir)/,,$(COVERAGE_FILES))
227 COVERAGE_OUT_FILES = $(foreach dir,$(COVERAGE_DIRS),$(wildcard $(top_builddir)/$(dir)/*.gcov.out))
228 COVERAGE_OUT_FILES_REL = $(subst $(top_builddir)/,,$(COVERAGE_OUT_FILES))
229
230 debug:
231         echo $(COVERAGE_FILES)
232         echo $(COVERAGE_FILES_REL)
233
234 .PHONY: coverage
235 if GST_GCOV_ENABLED
236 # we rebuild a registry and do gst-inspect so that all the get/set codepaths
237 # are also covered
238 coverage:
239         for file in `find $(top_builddir) -name '*.gcda'`; do rm $$file; done
240         -rm $(CHECK_REGISTRY)
241         echo "Inspecting all elements"
242         for e in `$(GST_INSPECT) | head -n -2 | cut -d: -f2`; do $(GST_INSPECT) $$e > /dev/null 2>&1; done
243         make check
244         make coverage-report
245 else
246 coverage:
247         echo "You need to configure with --enable-gcov to get coverage data"
248         exit 1
249 endif
250
251 coverage-report:
252         rm -r coverage
253         for dir in $(COVERAGE_DIRS); do                                 \
254           mkdir -p coverage/$$dir;                                      \
255           make -C $(top_builddir)/$$dir gcov;                           \
256         done
257         for dir in $(COVERAGE_DIRS); do                                 \
258             files="`ls $(top_builddir)/$$dir/*.gcov.out 2> /dev/null`"; \
259           if test ! -z "$$files"; then                                  \
260             perl $(top_srcdir)/common/coverage/coverage-report.pl       \
261               $(top_builddir)/$$dir/*.gcov.out >                        \
262               coverage/$$dir/index.xml;                                 \
263             xsltproc $(top_srcdir)/common/coverage/coverage-report.xsl  \
264               coverage/$$dir/index.xml > coverage/$$dir/index.html;     \
265           fi; \
266         done
267         for file in $(COVERAGE_FILES_REL); do                           \
268           echo Generating coverage/$$file.html;                         \
269           perl $(top_srcdir)/common/coverage/coverage-report-entry.pl   \
270             $(top_builddir)/$$file > coverage/$$file.html;              \
271         done