validate:launcher: Add a way to simply run validate default tests on uris

Summary:
This allows us to easily run all the scenarios on a particular file doing:

  $ gst-validate-launcher validate --validate-check-uri file:///some/media/file.webm

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D36
This commit is contained in:
Thibault Saunier 2015-03-13 17:09:08 +00:00
parent b8c085b319
commit d1411cfc6a
2 changed files with 21 additions and 7 deletions

View file

@ -27,7 +27,7 @@ from launcher.loggable import Loggable
from launcher.baseclasses import GstValidateTest, Test, \
ScenarioManager, NamedDic, GstValidateTestsGenerator, \
GstValidateMediaDescriptor, GstValidateEncodingTestInterface, \
GstValidateBaseTestManager, MediaDescriptor
GstValidateBaseTestManager, MediaDescriptor, MediaFormatCombination
from launcher.utils import path2url, DEFAULT_TIMEOUT, which, \
GST_SECOND, Result, Protocols, mkdir, printc, Colors
@ -221,7 +221,7 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator):
videosink = 'autovideosink'
pipeline_desc = pipeline % {'videosink': videosink,
'audiosink': audiosink}
'audiosink': audiosink}
fname = self.get_fname(scenario, protocol=mediainfo.get_protocol(), name=name)
@ -296,6 +296,9 @@ class GstValidateMixerTestsGenerator(GstValidatePipelineTestsGenerator):
valid_scenarios=valid_scenarios)
def populate_tests(self, uri_minfo_special_scenarios, scenarios):
if self.test_manager.options.validate_uris:
return
wanted_ressources = []
for uri, minfo, special_scenarios in uri_minfo_special_scenarios:
protocol = minfo.media_descriptor.get_protocol()
@ -547,10 +550,12 @@ class GstValidateTestManager(GstValidateBaseTestManager):
return False
def add_options(self, parser):
parser.add_argument_group("GstValidate tools specific options"
" and behaviours",
description="""When using --wanted-tests, all the scenarios can be used, even those which have
group = parser.add_argument_group("GstValidate tools specific options"
" and behaviours",
description="""When using --wanted-tests, all the scenarios can be used, even those which have
not been tested and explicitely activated if you set use --wanted-tests ALL""")
group.add_argument("--validate-check-uri", dest="validate_uris",
action="append", help="defines the uris to run default tests on")
def populate_testsuite(self):
@ -624,7 +629,7 @@ not been tested and explicitely activated if you set use --wanted-tests ALL""")
elif fpath.endswith(GstValidateMediaDescriptor.STREAM_INFO_EXT):
self._add_media(fpath)
return True
elif not self.options.generate_info and not self.options.update_media_info:
elif not self.options.generate_info and not self.options.update_media_info and not self.options.validate_uris:
return True
elif self.options.update_media_info and not os.path.isfile(media_info):
return True
@ -650,6 +655,11 @@ not been tested and explicitely activated if you set use --wanted-tests ALL""")
if self._uris:
return self._uris
if self.options.validate_uris:
for uri in self.options.validate_uris:
self._discover_file(uri, uri)
return self._uris
if not self.args:
if isinstance(self.options.paths, str):
self.options.paths = [os.path.join(self.options.paths)]
@ -692,6 +702,9 @@ not been tested and explicitely activated if you set use --wanted-tests ALL""")
except ValueError:
pass
if options.validate_uris:
self.check_testslist = False
super(GstValidateTestManager, self).set_settings(
options, args, reporter)

View file

@ -685,6 +685,7 @@ class TestsManager(Loggable):
self.jobs = []
self.total_num_tests = 0
self.starting_test_num = 0
self.check_testslist = True
def init(self):
return False
@ -1049,7 +1050,7 @@ class _TestsLauncher(Loggable):
return False
def _check_defined_tests(self, tester, tests):
if self.options.blacklisted_tests or self.options.wanted_tests:
if self.options.blacklisted_tests or self.options.wanted_tests and not self.check_testslist:
return
tests_names = [test.classname for test in tests]