validate:launcher: Add support for skipped media info files
authorThibault Saunier <tsaunier@igalia.com>
Tue, 7 Jan 2020 18:46:21 +0000 (15:46 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Wed, 11 Mar 2020 19:36:16 +0000 (16:36 -0300)
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

validate/launcher/apps/gstvalidate.py
validate/launcher/baseclasses.py

index d9a3df3a2fc8a08df684bdda43ca552550290cc1..7242dddda82c47efde5f55a3422b5b4fe81decfa 100644 (file)
@@ -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
+
+                if is_push:
                     uri = "push" + uri
-                args = GstValidateBaseTestManager.MEDIA_CHECK_COMMAND.split(" ")
 
+                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:
index 9553a8d67fa25def01fc8052215392ba5a8cc3f5..a3b8ce469e85d0418c935884e488df27d090a6a9 100644 (file)
@@ -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: