From 044ab241ee05301f8c980bcab1ff0ac5cfa4c231 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 21 Apr 2015 11:00:58 +0200 Subject: [PATCH] validate: use -debug versions of bins when running from source Summary: Those versions are using rpath instead of libtool's wrappers and so will be faster to start and won't confuse valgrind. Reviewers: thiblahute Differential Revision: http://phabricator.freedesktop.org/D116 --- validate/launcher/baseclasses.py | 17 +++++++++++++++-- validate/tools/Makefile.am | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py index 299bd6828a..505abb5f6e 100644 --- a/validate/launcher/baseclasses.py +++ b/validate/launcher/baseclasses.py @@ -397,6 +397,14 @@ class GstValidateTest(Test): else: hard_timeout = None + # If we are running from source, use the -debug version of the + # application which is using rpath instead of libtool's wrappers. It's + # slightly faster to start and will not confuse valgrind. + debug = '%s-debug' % application_name + p = self.look_for_file_in_source_dir('tools', debug) + if p: + application_name = p + super(GstValidateTest, self).__init__(application_name, classname, options, reporter, duration=duration, @@ -618,13 +626,18 @@ class GstValidateTest(Test): return position - def get_valgrind_suppression_file(self, subdir, name): - # Are we running from sources? + def look_for_file_in_source_dir(self, subdir, name): root_dir = os.path.abspath(os.path.dirname(os.path.join(os.path.dirname(os.path.abspath(__file__))))) p = os.path.join(root_dir, subdir, name) if os.path.exists(p): return p + def get_valgrind_suppression_file(self, subdir, name): + # Are we running from sources? + p = self.look_for_file_in_source_dir(subdir, name) + if p: + return p + # Look in system data dirs p = os.path.join(config.DATADIR, 'gstreamer-1.0', 'validate', name) if os.path.exists(p): diff --git a/validate/tools/Makefile.am b/validate/tools/Makefile.am index 43545d3bbb..db5ed4b8d5 100644 --- a/validate/tools/Makefile.am +++ b/validate/tools/Makefile.am @@ -3,16 +3,35 @@ bin_PROGRAMS = \ gst-validate-transcoding-@GST_API_VERSION@ \ gst-validate-media-check-@GST_API_VERSION@ +noinst_PROGRAMS = \ + gst-validate-@GST_API_VERSION@-debug \ + gst-validate-transcoding-@GST_API_VERSION@-debug \ + gst-validate-media-check-@GST_API_VERSION@-debug + bin_SCRIPTS = \ gst-validate-launcher AM_CFLAGS = $(GST_ALL_CFLAGS) $(GST_PBUTILS_CFLAGS) $(GST_VIDEO_CFLAGS) LDADD = $(top_builddir)/gst/validate/libgstvalidate-@GST_API_VERSION@.la $(GST_PBUTILS_LIBS) $(GST_LIBS) $(GST_VIDEO_LIBS) $(FAULTINJECTION_LIBS) +# The -debug versions are used when running from sources to not confuse +# valgrind with libtool's wrappers. Those are built with the '-no-install' and +# so use rpath instead of wrappers. gst_validate_@GST_API_VERSION@_SOURCES = gst-validate.c gst_validate_@GST_API_VERSION@_CFLAGS = $(GIO_CFLAGS) $(AM_CFLAGS) gst_validate_@GST_API_VERSION@_LDADD = $(GIO_LIBS) $(LDADD) + +gst_validate_@GST_API_VERSION@_debug_SOURCES = gst-validate.c +gst_validate_@GST_API_VERSION@_debug_CFLAGS = $(GIO_CFLAGS) $(AM_CFLAGS) +gst_validate_@GST_API_VERSION@_debug_LDADD = $(GIO_LIBS) $(LDADD) +gst_validate_@GST_API_VERSION@_debug_LDFLAGS = -no-install + gst_validate_transcoding_@GST_API_VERSION@_SOURCES = gst-validate-transcoding.c +gst_validate_transcoding_@GST_API_VERSION@_debug_SOURCES = gst-validate-transcoding.c +gst_validate_transcoding_@GST_API_VERSION@_debug_LDFLAGS = -no-install + gst_validate_media_check_@GST_API_VERSION@_SOURCES = gst-validate-media-check.c +gst_validate_media_check_@GST_API_VERSION@_debug_SOURCES = gst-validate-media-check.c +gst_validate_media_check_@GST_API_VERSION@_debug_LDFLAGS = -no-install CLEANFILES = $(bin_SCRIPTS)