1include $(top_srcdir)/common/check.mak 2 3CHECK_REGISTRY = $(top_builddir)/tests/check/test-registry.reg 4 5GST_TOOLS_DIR = $(top_builddir)/tools 6 7REGISTRY_ENVIRONMENT = \ 8 GST_REGISTRY=$(CHECK_REGISTRY) 9 10AM_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 17plugindir = $(libdir)/gstreamer-@GST_API_VERSION@ 18 19# override to _not_ install the test plugins 20install-pluginLTLIBRARIES: 21 22# the core dumps of some machines have PIDs appended, test registry and 23# profiling data 24CLEANFILES = core core.* test-registry.* *.gcno *.gcda 25 26SUPPRESSIONS = $(top_srcdir)/common/gst.supp 27 28clean-local: clean-local-check 29 30# These tests don't even build any longer: 31# gst/gstindex.c 32 33if GST_DISABLE_PARSE 34PARSE_CHECKS = pipelines/parse-disabled 35else 36PARSE_CHECKS = pipelines/simple-launch-lines pipelines/cleanup pipelines/parse-launch 37endif 38 39# Do not run the abi test in case any option which causes the API to change has 40# been used 41if !GST_DISABLE_REGISTRY 42ABI_CHECKS = gst/gstabi 43endif 44 45if !GST_DISABLE_GST_DEBUG 46PRINTF_CHECKS = gst/gstprintf 47else 48PRINTF_CHECKS = 49endif 50 51LIBSABI_CHECKS = libs/libsabi 52 53if HAVE_CXX 54CXX_CHECKS = gst/gstcpp libs/gstlibscpp 55else 56CXX_CHECKS = 57endif 58 59# if it's calling gst_element_factory_make(), it will probably not work without 60# a registry 61if GST_DISABLE_REGISTRY 62REGISTRY_CHECKS = 63else 64REGISTRY_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 109endif 110 111check_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/bitwriter \ 158 libs/bytereader \ 159 libs/bytewriter \ 160 libs/bitreader-noinline \ 161 libs/bytereader-noinline \ 162 libs/bytewriter-noinline \ 163 libs/flowcombiner \ 164 libs/sparsefile \ 165 libs/collectpads \ 166 libs/gstharness \ 167 libs/gstnetclientclock \ 168 libs/gstnettimeprovider \ 169 libs/gsttestclock \ 170 libs/transform1 \ 171 libs/transform2 \ 172 tools/gstinspect 173 174# failing tests 175noinst_PROGRAMS = 176 177# elements to ignore for the state tests 178# STATE_IGNORE_ELEMENTS = 179 180TESTS = $(check_PROGRAMS) 181 182noinst_HEADERS = \ 183 gst/capslist.h \ 184 gst/struct_arm.h \ 185 gst/struct_i386.h \ 186 gst/struct_i386w.h \ 187 gst/struct_hppa.h \ 188 gst/struct_ppc32.h \ 189 gst/struct_ppc64.h \ 190 gst/struct_sparc.h \ 191 gst/struct_x86_64.h \ 192 gst/struct_x86_64w.h \ 193 libs/struct_arm.h \ 194 libs/struct_i386.h \ 195 libs/struct_hppa.h \ 196 libs/struct_ppc32.h \ 197 libs/struct_ppc64.h \ 198 libs/struct_sparc.h \ 199 libs/struct_x86_64.h 200 201EXTRA_DIST = \ 202 libs/test_transform.c 203 204AM_CFLAGS = $(PTHREAD_CFLAGS) $(GST_OBJ_CFLAGS) -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS \ 205 -DGST_CHECK_TEST_ENVIRONMENT_BEACON="\"GST_STATE_IGNORE_ELEMENTS\"" 206AM_CXXFLAGS = $(GST_OBJ_CXXFLAGS) -UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS \ 207 -DGST_CHECK_TEST_ENVIRONMENT_BEACON="\"GST_STATE_IGNORE_ELEMENTS\"" 208LDADD = $(top_builddir)/libs/gst/check/libgstcheck-@GST_API_VERSION@.la \ 209 $(top_builddir)/libs/gst/base/libgstbase-@GST_API_VERSION@.la \ 210 $(GST_OBJ_LIBS) 211 212gst_gstcpp_SOURCES = gst/gstcpp.cc 213 214libs_gstlibscpp_SOURCES = libs/gstlibscpp.cc 215 216gst_gsttracerrecord_CFLAGS = $(GST_OBJ_CFLAGS) $(AM_CFLAGS) -DGST_USE_UNSTABLE_API 217 218gst_gstutils_LDADD = $(LDADD) $(GSL_LIBS) $(GMP_LIBS) 219 220gst_gstprintf_LDADD = \ 221 $(top_builddir)/gst/printf/libgstprintf.la \ 222 $(LDADD) 223 224elements_fdsrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \ 225 -DTESTFILE=\"$(top_srcdir)/configure.ac\" 226elements_filesrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \ 227 -DTESTFILE=\"$(top_srcdir)/configure.ac\" 228 229libs_controller_LDADD = \ 230 $(top_builddir)/libs/gst/controller/libgstcontroller-@GST_API_VERSION@.la \ 231 $(LDADD) 232libs_gstnetclientclock_LDADD = \ 233 $(top_builddir)/libs/gst/net/libgstnet-@GST_API_VERSION@.la \ 234 $(LDADD) 235libs_gstnettimeprovider_LDADD = \ 236 $(top_builddir)/libs/gst/net/libgstnet-@GST_API_VERSION@.la \ 237 $(GIO_LIBS) $(LDADD) 238 239# valgrind testing 240# these just need valgrind fixing, period 241VALGRIND_TO_FIX = \ 242 gst/gstinfo \ 243 gst/gsttracerrecord \ 244 tools/gstinspect 245 246VALGRIND_IGNORE = \ 247 pipelines/stress 248 249# these need fixing because the threads cause segfaults under valgrind 250TESTS_THREADED = \ 251 gst/gstminiobject \ 252 gst/gstobject 253 254VALGRIND_TESTS_DISABLE = \ 255 $(TESTS_THREADED) \ 256 $(VALGRIND_IGNORE) \ 257 $(VALGRIND_TO_FIX) 258 259# indexers does not get tested yet 260COVERAGE_DIRS = \ 261 gst \ 262 libs/gst/base \ 263 libs/gst/controller \ 264 libs/gst/check \ 265 libs/gst/net \ 266 plugins/elements 267COVERAGE_FILES = $(foreach dir,$(COVERAGE_DIRS),$(wildcard $(top_builddir)/$(dir)/*.gcov)) 268COVERAGE_FILES_REL = $(subst $(top_builddir)/,,$(COVERAGE_FILES)) 269COVERAGE_OUT_FILES = $(foreach dir,$(COVERAGE_DIRS),$(wildcard $(top_builddir)/$(dir)/*.gcov.out)) 270COVERAGE_OUT_FILES_REL = $(subst $(top_builddir)/,,$(COVERAGE_OUT_FILES)) 271 272debug: 273 echo $(COVERAGE_FILES) 274 echo $(COVERAGE_FILES_REL) 275 276.PHONY: coverage 277if GST_GCOV_ENABLED 278# we rebuild a registry and do gst-inspect so that all the get/set codepaths 279# are also covered 280coverage: 281 for file in `find $(top_builddir) -name '*.gcda'`; do rm $$file; done 282 -rm $(CHECK_REGISTRY) 283 echo "Inspecting all elements" 284 for e in `$(GST_INSPECT) | head -n -2 | cut -d: -f2`; do $(GST_INSPECT) $$e > /dev/null 2>&1; done 285 make check 286 make coverage-report 287else 288coverage: 289 echo "You need to configure with --enable-gcov to get coverage data" 290 exit 1 291endif 292 293coverage-report: 294 rm -r coverage 295 for dir in $(COVERAGE_DIRS); do \ 296 mkdir -p coverage/$$dir; \ 297 make -C $(top_builddir)/$$dir gcov; \ 298 done 299 for dir in $(COVERAGE_DIRS); do \ 300 files="`ls $(top_builddir)/$$dir/*.gcov.out 2> /dev/null`"; \ 301 if test ! -z "$$files"; then \ 302 perl $(top_srcdir)/common/coverage/coverage-report.pl \ 303 $(top_builddir)/$$dir/*.gcov.out > \ 304 coverage/$$dir/index.xml; \ 305 xsltproc $(top_srcdir)/common/coverage/coverage-report.xsl \ 306 coverage/$$dir/index.xml > coverage/$$dir/index.html; \ 307 fi; \ 308 done 309 for file in $(COVERAGE_FILES_REL); do \ 310 echo Generating coverage/$$file.html; \ 311 perl $(top_srcdir)/common/coverage/coverage-report-entry.pl \ 312 $(top_builddir)/$$file > coverage/$$file.html; \ 313 done 314