mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-01 03:52:25 +00:00
validate:launcher: Add support for skipped media info files
Those are skipped to generate tests by default but are updated when required, this will allow us to generate specific test on demand for those
This commit is contained in:
parent
78f2026467
commit
b4c1424ea2
2 changed files with 20 additions and 13 deletions
|
@ -963,22 +963,25 @@ not been tested and explicitely activated if you set use --wanted-tests ALL""")
|
|||
|
||||
def _discover_file(self, uri, fpath):
|
||||
for ext in (GstValidateMediaDescriptor.MEDIA_INFO_EXT,
|
||||
GstValidateMediaDescriptor.PUSH_MEDIA_INFO_EXT):
|
||||
GstValidateMediaDescriptor.PUSH_MEDIA_INFO_EXT,
|
||||
GstValidateMediaDescriptor.SKIPPED_MEDIA_INFO_EXT):
|
||||
try:
|
||||
is_push = False
|
||||
is_push = ext == GstValidateMediaDescriptor.PUSH_MEDIA_INFO_EXT
|
||||
is_skipped = ext == GstValidateMediaDescriptor.SKIPPED_MEDIA_INFO_EXT
|
||||
media_info = "%s.%s" % (fpath, ext)
|
||||
if ext == GstValidateMediaDescriptor.PUSH_MEDIA_INFO_EXT:
|
||||
if is_push or is_skipped:
|
||||
if not os.path.exists(media_info):
|
||||
continue
|
||||
is_push = True
|
||||
uri = "push" + uri
|
||||
args = GstValidateBaseTestManager.MEDIA_CHECK_COMMAND.split(" ")
|
||||
|
||||
if is_push:
|
||||
uri = "push" + uri
|
||||
|
||||
args = GstValidateBaseTestManager.MEDIA_CHECK_COMMAND.split(" ")
|
||||
args.append(uri)
|
||||
if os.path.isfile(media_info) and not self.options.update_media_info:
|
||||
if os.path.isfile(media_info) and not self.options.update_media_info and not is_skipped:
|
||||
self._add_media(media_info, uri)
|
||||
continue
|
||||
elif fpath.endswith(GstValidateMediaDescriptor.STREAM_INFO_EXT):
|
||||
elif fpath.endswith(GstValidateMediaDescriptor.STREAM_INFO_EXT) and not is_skipped:
|
||||
self._add_media(fpath)
|
||||
continue
|
||||
elif not self.options.generate_info and not self.options.update_media_info and not self.options.validate_uris:
|
||||
|
@ -999,7 +1002,7 @@ not been tested and explicitely activated if you set use --wanted-tests ALL""")
|
|||
include_frames = 1
|
||||
|
||||
media_descriptor = GstValidateMediaDescriptor.new_from_uri(
|
||||
uri, True, include_frames, is_push)
|
||||
uri, True, include_frames, is_push, is_skipped)
|
||||
if media_descriptor:
|
||||
self._add_media(media_descriptor, uri)
|
||||
else:
|
||||
|
|
|
@ -2481,6 +2481,7 @@ class MediaDescriptor(Loggable):
|
|||
|
||||
class GstValidateMediaDescriptor(MediaDescriptor):
|
||||
# Some extension file for discovering results
|
||||
SKIPPED_MEDIA_INFO_EXT = "media_info.skipped"
|
||||
MEDIA_INFO_EXT = "media_info"
|
||||
PUSH_MEDIA_INFO_EXT = "media_info.push"
|
||||
STREAM_INFO_EXT = "stream_info"
|
||||
|
@ -2561,14 +2562,14 @@ class GstValidateMediaDescriptor(MediaDescriptor):
|
|||
|
||||
def __cleanup_media_info_ext(self):
|
||||
for ext in [self.MEDIA_INFO_EXT, self.PUSH_MEDIA_INFO_EXT, self.STREAM_INFO_EXT,
|
||||
]:
|
||||
self.SKIPPED_MEDIA_INFO_EXT, ]:
|
||||
if self._xml_path.endswith(ext):
|
||||
return self._xml_path[:len(self._xml_path) - (len(ext) + 1)]
|
||||
|
||||
assert "Not reached" is None
|
||||
|
||||
@staticmethod
|
||||
def new_from_uri(uri, verbose=False, include_frames=False, is_push=False):
|
||||
def new_from_uri(uri, verbose=False, include_frames=False, is_push=False, is_skipped=False):
|
||||
"""
|
||||
include_frames = 0 # Never
|
||||
include_frames = 1 # always
|
||||
|
@ -2577,8 +2578,11 @@ class GstValidateMediaDescriptor(MediaDescriptor):
|
|||
"""
|
||||
media_path = utils.url2path(uri)
|
||||
|
||||
ext = GstValidateMediaDescriptor.PUSH_MEDIA_INFO_EXT if is_push else \
|
||||
GstValidateMediaDescriptor.MEDIA_INFO_EXT
|
||||
ext = GstValidateMediaDescriptor.MEDIA_INFO_EXT
|
||||
if is_push:
|
||||
ext = GstValidateMediaDescriptor.PUSH_MEDIA_INFO_EXT
|
||||
elif is_skipped:
|
||||
ext = GstValidateMediaDescriptor.SKIPPED_MEDIA_INFO_EXT
|
||||
descriptor_path = "%s.%s" % (media_path, ext)
|
||||
args = GstValidateBaseTestManager.MEDIA_CHECK_COMMAND.split(" ")
|
||||
if include_frames == 2:
|
||||
|
|
Loading…
Reference in a new issue