From 787939f7505407949a104539688905bc4057d2d4 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Thu, 28 Mar 2019 10:08:16 -0300 Subject: [PATCH] validate:launcher: Add a list of well known subpression files from gst-build subprojects Fixes https://gitlab.freedesktop.org/gstreamer/gst-devtools/issues/38 --- validate/launcher/apps/gstcheck.py | 18 +++++++++++++----- validate/launcher/baseclasses.py | 2 ++ validate/launcher/utils.py | 25 +++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/validate/launcher/apps/gstcheck.py b/validate/launcher/apps/gstcheck.py index cf660f116e..0313425c04 100644 --- a/validate/launcher/apps/gstcheck.py +++ b/validate/launcher/apps/gstcheck.py @@ -30,7 +30,7 @@ import concurrent.futures as conc from launcher import config -from launcher.utils import printc, Colors +from launcher.utils import printc, Colors, get_gst_build_valgrind_suppressions from launcher.main import setup_launcher_from_args from launcher.baseclasses import VALGRIND_TIMEOUT_FACTOR @@ -68,6 +68,14 @@ class MesonTest(Test): return env +class GstCheckTest(MesonTest): + def get_valgrind_suppressions(self): + result = super().get_valgrind_suppressions() + result.extend(get_gst_build_valgrind_suppressions()) + + return result + + class MesonTestsManager(TestsManager): name = "mesontest" arggroup = None @@ -337,14 +345,14 @@ class GstCheckTestsManager(MesonTestsManager): gst_tests = self.tests_info[test['cmd'][0]][1] if not gst_tests: child_env = self.get_child_env(name) - self.add_test(MesonTest(name, self.options, self.reporter, test, - child_env)) + self.add_test(GstCheckTest(name, self.options, self.reporter, test, + child_env)) else: for ltest in gst_tests: name = self.get_test_name(test) + '.' + ltest child_env = self.get_child_env(name, ltest) - self.add_test(MesonTest(name, self.options, self.reporter, test, - child_env)) + self.add_test(GstCheckTest(name, self.options, self.reporter, test, + child_env)) self.save_tests_info() self._registered = True return self.tests diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py index 2b067f77f9..f4cd68cc37 100644 --- a/validate/launcher/baseclasses.py +++ b/validate/launcher/baseclasses.py @@ -1099,9 +1099,11 @@ class GstValidateTest(Test): def get_valgrind_suppressions(self): result = super(GstValidateTest, self).get_valgrind_suppressions() + result.extend(utils.get_gst_build_valgrind_suppressions()) gst_sup = self.get_valgrind_suppression_file('common', 'gst.supp') if gst_sup: result.append(gst_sup) + return result diff --git a/validate/launcher/utils.py b/validate/launcher/utils.py index 7daf7bc243..2d597148b6 100644 --- a/validate/launcher/utils.py +++ b/validate/launcher/utils.py @@ -330,6 +330,31 @@ def get_scenarios(): )) +def get_gst_build_valgrind_suppressions(): + if hasattr(get_gst_build_valgrind_suppressions, "data"): + return get_gst_build_valgrind_suppressions.data + + get_gst_build_valgrind_suppressions.data = [] + if not os.path.exists(os.path.join(config.SRCDIR, "subprojects")): + return get_gst_build_valgrind_suppressions.data + + for suppression_path in ["gstreamer/tests/check/gstreamer.supp", + "gst-plugins-base/tests/check/gst-plugins-base.supp", + "gst-plugins-good/tests/check/gst-plugins-good.supp", + "gst-plugins-bad/tests/check/gst-plugins-bad.supp", + "gst-plugins-ugly/tests/check/gst-plugins-ugly.supp", + "gst-libav/tests/check/gst-libav.supp", + "gst-devtools/validate/data/gstvalidate.supp", + "libnice/tests/libnice.supp", + "libsoup/tests/libsoup.supp", + "glib/glib.supp"]: + suppression = os.path.join(config.SRCDIR, "subprojects", suppression_path) + if os.path.exists(suppression): + get_gst_build_valgrind_suppressions.data.append(suppression) + + return get_gst_build_valgrind_suppressions.data + + class BackTraceGenerator(Loggable): __instance = None _command_line_regex = re.compile(r'Command Line: (.*)\n')