tests: abi: fix abi test on 64-bit Windows
[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 ABI_CHECKS = gst/gstabi
43 endif
44
45 if !GST_DISABLE_GST_DEBUG
46 PRINTF_CHECKS = gst/gstprintf
47 else
48 PRINTF_CHECKS =
49 endif
50
51 LIBSABI_CHECKS = libs/libsabi
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/gstcontext                          \
69         gst/gstcontroller                       \
70         gst/gstelement                          \
71         gst/gstelementfactory                   \
72         gst/gstevent                            \
73         gst/gstghostpad                         \
74         gst/gstplugin                           \
75         gst/gstpreset                           \
76         gst/gstprotection                       \
77         gst/gstquery                            \
78         gst/gstregistry                         \
79         gst/gsturi                              \
80         gst/gstutils                            \
81         generic/sinks                           \
82         elements/capsfilter                     \
83         elements/concat                         \
84         elements/dataurisrc                     \
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/gstdeinit                           \
125         gst/gstdevice                           \
126         gst/gstinfo                             \
127         gst/gstiterator                         \
128         gst/gstmessage                          \
129         gst/gstminiobject                       \
130         gst/gstobject                           \
131         gst/gstpad                              \
132         gst/gstparamspecs                       \
133         gst/gstpipeline                         \
134         gst/gstpoll                             \
135         gst/gstprotection                       \
136         $(PRINTF_CHECKS)                        \
137         gst/gstpromise                          \
138         gst/gstsegment                          \
139         gst/gstsystemclock                      \
140         gst/gstclock                            \
141         gst/gststream                           \
142         gst/gststructure                        \
143         gst/gsttag                              \
144         gst/gsttracerrecord                             \
145         gst/gsttagsetter                        \
146         gst/gsttask                             \
147         gst/gsttoc                              \
148         gst/gsttocsetter                        \
149         gst/gstvalue                            \
150         generic/states                          \
151         $(PARSE_CHECKS)                         \
152         $(REGISTRY_CHECKS)                      \
153         $(LIBSABI_CHECKS)                       \
154         libs/adapter                            \
155         libs/aggregator                         \
156         libs/bitreader                          \
157         libs/bytereader                         \
158         libs/bytewriter                         \
159         libs/bitreader-noinline         \
160         libs/bytereader-noinline        \
161         libs/bytewriter-noinline        \
162         libs/flowcombiner                       \
163         libs/sparsefile                         \
164         libs/collectpads                        \
165         libs/gstharness                         \
166         libs/gstnetclientclock                  \
167         libs/gstnettimeprovider                 \
168         libs/gsttestclock                       \
169         libs/transform1                         \
170         libs/transform2                         \
171         tools/gstinspect
172
173 # failing tests
174 noinst_PROGRAMS =
175
176 # elements to ignore for the state tests
177 # STATE_IGNORE_ELEMENTS =
178
179 TESTS = $(check_PROGRAMS)
180
181 noinst_HEADERS = \
182         gst/capslist.h \
183         gst/struct_arm.h \
184         gst/struct_i386.h \
185         gst/struct_i386w.h \
186         gst/struct_hppa.h \
187         gst/struct_ppc32.h \
188         gst/struct_ppc64.h \
189         gst/struct_sparc.h \
190         gst/struct_x86_64.h \
191         gst/struct_x86_64w.h \
192         libs/struct_arm.h \
193         libs/struct_i386.h \
194         libs/struct_hppa.h \
195         libs/struct_ppc32.h \
196         libs/struct_ppc64.h \
197         libs/struct_sparc.h \
198         libs/struct_x86_64.h
199
200 EXTRA_DIST = \
201         libs/test_transform.c
202
203 AM_CFLAGS = $(PTHREAD_CFLAGS) $(GST_OBJ_CFLAGS) -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS \
204         -DGST_CHECK_TEST_ENVIRONMENT_BEACON="\"GST_STATE_IGNORE_ELEMENTS\""
205 AM_CXXFLAGS = $(GST_OBJ_CXXFLAGS) -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS \
206         -DGST_CHECK_TEST_ENVIRONMENT_BEACON="\"GST_STATE_IGNORE_ELEMENTS\""
207 LDADD = $(top_builddir)/libs/gst/check/libgstcheck-@GST_API_VERSION@.la \
208         $(top_builddir)/libs/gst/base/libgstbase-@GST_API_VERSION@.la \
209         $(GST_OBJ_LIBS)
210
211 gst_gstcpp_SOURCES = gst/gstcpp.cc
212
213 libs_gstlibscpp_SOURCES = libs/gstlibscpp.cc
214
215 gst_gsttracerrecord_CFLAGS = $(GST_OBJ_CFLAGS) $(AM_CFLAGS) -DGST_USE_UNSTABLE_API
216
217 gst_gstutils_LDADD = $(LDADD) $(GSL_LIBS) $(GMP_LIBS)
218
219 gst_gstprintf_LDADD = \
220         $(top_builddir)/gst/printf/libgstprintf.la \
221         $(LDADD)
222
223 elements_fdsrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \
224         -DTESTFILE=\"$(top_srcdir)/configure.ac\"
225 elements_filesrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \
226         -DTESTFILE=\"$(top_srcdir)/configure.ac\"
227
228 libs_controller_LDADD = \
229         $(top_builddir)/libs/gst/controller/libgstcontroller-@GST_API_VERSION@.la \
230         $(LDADD)
231 libs_gstnetclientclock_LDADD = \
232         $(top_builddir)/libs/gst/net/libgstnet-@GST_API_VERSION@.la \
233         $(LDADD)
234 libs_gstnettimeprovider_LDADD = \
235         $(top_builddir)/libs/gst/net/libgstnet-@GST_API_VERSION@.la \
236         $(GIO_LIBS) $(LDADD)
237
238 # valgrind testing
239 # these just need valgrind fixing, period
240 VALGRIND_TO_FIX = \
241         gst/gstinfo \
242         gst/gsttracerrecord \
243         tools/gstinspect
244
245 VALGRIND_IGNORE = \
246         pipelines/stress
247
248 # these need fixing because the threads cause segfaults under valgrind
249 TESTS_THREADED =                                \
250         gst/gstminiobject                       \
251         gst/gstobject
252
253 VALGRIND_TESTS_DISABLE =                                        \
254         $(TESTS_THREADED)                                       \
255         $(VALGRIND_IGNORE)                                      \
256         $(VALGRIND_TO_FIX)
257
258 # indexers does not get tested yet
259 COVERAGE_DIRS = \
260         gst \
261         libs/gst/base \
262         libs/gst/controller \
263         libs/gst/check \
264         libs/gst/net \
265         plugins/elements
266 COVERAGE_FILES = $(foreach dir,$(COVERAGE_DIRS),$(wildcard $(top_builddir)/$(dir)/*.gcov))
267 COVERAGE_FILES_REL = $(subst $(top_builddir)/,,$(COVERAGE_FILES))
268 COVERAGE_OUT_FILES = $(foreach dir,$(COVERAGE_DIRS),$(wildcard $(top_builddir)/$(dir)/*.gcov.out))
269 COVERAGE_OUT_FILES_REL = $(subst $(top_builddir)/,,$(COVERAGE_OUT_FILES))
270
271 debug:
272         echo $(COVERAGE_FILES)
273         echo $(COVERAGE_FILES_REL)
274
275 .PHONY: coverage
276 if GST_GCOV_ENABLED
277 # we rebuild a registry and do gst-inspect so that all the get/set codepaths
278 # are also covered
279 coverage:
280         for file in `find $(top_builddir) -name '*.gcda'`; do rm $$file; done
281         -rm $(CHECK_REGISTRY)
282         echo "Inspecting all elements"
283         for e in `$(GST_INSPECT) | head -n -2 | cut -d: -f2`; do $(GST_INSPECT) $$e > /dev/null 2>&1; done
284         make check
285         make coverage-report
286 else
287 coverage:
288         echo "You need to configure with --enable-gcov to get coverage data"
289         exit 1
290 endif
291
292 coverage-report:
293         rm -r coverage
294         for dir in $(COVERAGE_DIRS); do                                 \
295           mkdir -p coverage/$$dir;                                      \
296           make -C $(top_builddir)/$$dir gcov;                           \
297         done
298         for dir in $(COVERAGE_DIRS); do                                 \
299             files="`ls $(top_builddir)/$$dir/*.gcov.out 2> /dev/null`"; \
300           if test ! -z "$$files"; then                                  \
301             perl $(top_srcdir)/common/coverage/coverage-report.pl       \
302               $(top_builddir)/$$dir/*.gcov.out >                        \
303               coverage/$$dir/index.xml;                                 \
304             xsltproc $(top_srcdir)/common/coverage/coverage-report.xsl  \
305               coverage/$$dir/index.xml > coverage/$$dir/index.html;     \
306           fi; \
307         done
308         for file in $(COVERAGE_FILES_REL); do                           \
309           echo Generating coverage/$$file.html;                         \
310           perl $(top_srcdir)/common/coverage/coverage-report-entry.pl   \
311             $(top_builddir)/$$file > coverage/$$file.html;              \
312         done