From 794ffe6ec6cb777b72d2a3ecc79a50def2a5c82d Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 27 Dec 2022 00:24:36 +1100 Subject: [PATCH] validate: Place regex flags at the start of the regex In Python 3.11 it is an error to have regex flags in the middle of an expression, so make sure they appear at the start. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1630 Part-of: --- subprojects/gst-devtools/validate/launcher/apps/gstvalidate.py | 4 ++-- subprojects/gst-devtools/validate/launcher/baseclasses.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-devtools/validate/launcher/apps/gstvalidate.py b/subprojects/gst-devtools/validate/launcher/apps/gstvalidate.py index 46188f8..1aef8e6 100644 --- a/subprojects/gst-devtools/validate/launcher/apps/gstvalidate.py +++ b/subprojects/gst-devtools/validate/launcher/apps/gstvalidate.py @@ -1333,8 +1333,8 @@ not been tested and explicitly activated if you set use --wanted-tests ALL""") "matroskademux.gst_matroska_demux_handle_seek_push: Seek end-time not supported in streaming mode"), # MPEG TS known issues: - ('(?i)*playback.reverse_playback.*(?:_|.)(?:|m)ts$', - "https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/97"), + ('*.playback.reverse_playback.*(?:_|.)(?:|m)ts$', + "https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/97", '(?i)'), # Fragmented MP4 disabled tests: ('*.playback..*seek.*.fragmented_nonseekable_sink_mp4', diff --git a/subprojects/gst-devtools/validate/launcher/baseclasses.py b/subprojects/gst-devtools/validate/launcher/baseclasses.py index 65a3791..0368c3f 100644 --- a/subprojects/gst-devtools/validate/launcher/baseclasses.py +++ b/subprojects/gst-devtools/validate/launcher/baseclasses.py @@ -1565,9 +1565,13 @@ class TestsManager(Loggable): self.blacklisted_tests_patterns.append(re.compile(pattern)) def set_default_blacklist(self, default_blacklist): - for test_regex, reason in default_blacklist: + for test_regex, reason, *re_flags in default_blacklist: + re_flags = re_flags[0] if re_flags else None + if not test_regex.startswith(self.loading_testsuite + '.'): test_regex = self.loading_testsuite + '.' + test_regex + if re_flags is not None: + test_regex = re_flags + test_regex self.blacklisted_tests.append((test_regex, reason)) self._add_blacklist(test_regex) -- 2.7.4