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