mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-28 17:25:05 +00:00
validate:launcher: Properly handle missing scenarios on the system
This commit is contained in:
parent
339703d2eb
commit
3d8201d52b
|
@ -175,6 +175,7 @@ class GESTestsManager(TestsManager):
|
||||||
def init(self):
|
def init(self):
|
||||||
try:
|
try:
|
||||||
if "--set-scenario=" in subprocess.check_output([GES_LAUNCH_COMMAND, "--help"]):
|
if "--set-scenario=" in subprocess.check_output([GES_LAUNCH_COMMAND, "--help"]):
|
||||||
|
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.warning("Can not use ges-launch, it seems not to be compiled against"
|
self.warning("Can not use ges-launch, it seems not to be compiled against"
|
||||||
|
@ -198,7 +199,6 @@ class GESTestsManager(TestsManager):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.makedirs(utils.url2path(options.dest)[0])
|
os.makedirs(utils.url2path(options.dest)[0])
|
||||||
print "Created directory: %s" % options.dest
|
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -210,7 +210,6 @@ class GESTestsManager(TestsManager):
|
||||||
for f in files:
|
for f in files:
|
||||||
if not f.endswith(".xges"):
|
if not f.endswith(".xges"):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
projects.append(utils.path2url(os.path.join(path, root, f)))
|
projects.append(utils.path2url(os.path.join(path, root, f)))
|
||||||
else:
|
else:
|
||||||
for proj in self.args:
|
for proj in self.args:
|
||||||
|
@ -227,6 +226,8 @@ class GESTestsManager(TestsManager):
|
||||||
# First playback casses
|
# First playback casses
|
||||||
for scenario_name in SCENARIOS:
|
for scenario_name in SCENARIOS:
|
||||||
scenario = self._scenarios.get_scenario(scenario_name)
|
scenario = self._scenarios.get_scenario(scenario_name)
|
||||||
|
if scenario is None:
|
||||||
|
continue
|
||||||
classname = "ges.playback.%s.%s" % (scenario.name,
|
classname = "ges.playback.%s.%s" % (scenario.name,
|
||||||
os.path.basename(proj).replace(".xges", ""))
|
os.path.basename(proj).replace(".xges", ""))
|
||||||
self.add_test(GESPlaybackTest(classname,
|
self.add_test(GESPlaybackTest(classname,
|
||||||
|
|
|
@ -70,7 +70,12 @@ class PlaybinDescriptor(PipelineDescriptor):
|
||||||
# definitions of commands to use
|
# definitions of commands to use
|
||||||
GST_VALIDATE_COMMAND = "gst-validate-1.0"
|
GST_VALIDATE_COMMAND = "gst-validate-1.0"
|
||||||
GST_VALIDATE_TRANSCODING_COMMAND = "gst-validate-transcoding-1.0"
|
GST_VALIDATE_TRANSCODING_COMMAND = "gst-validate-transcoding-1.0"
|
||||||
G_V_DISCOVERER_COMMAND = "gst-validate-media-check-1.0 --discover-only"
|
G_V_DISCOVERER_COMMAND = "gst-validate-media-check-1.0"
|
||||||
|
if "win32" in sys.platform:
|
||||||
|
GST_VALIDATE_COMMAND += ".exe"
|
||||||
|
GST_VALIDATE_TRANSCODING_COMMAND += ".exe"
|
||||||
|
G_V_DISCOVERER_COMMAND += ".exe"
|
||||||
|
G_V_DISCOVERER_COMMAND += " --discover-only"
|
||||||
|
|
||||||
# Some extension file for discovering results
|
# Some extension file for discovering results
|
||||||
G_V_MEDIA_INFO_EXT = "media_info"
|
G_V_MEDIA_INFO_EXT = "media_info"
|
||||||
|
|
|
@ -645,12 +645,11 @@ class ScenarioManager(Loggable):
|
||||||
cls._instance = super(ScenarioManager, cls).__new__(
|
cls._instance = super(ScenarioManager, cls).__new__(
|
||||||
cls, *args, **kwargs)
|
cls, *args, **kwargs)
|
||||||
cls._instance.config = None
|
cls._instance.config = None
|
||||||
|
cls._instance.discovered = False
|
||||||
|
Loggable.__init__(cls._instance)
|
||||||
|
|
||||||
return cls._instance
|
return cls._instance
|
||||||
|
def _discover_scenarios(self):
|
||||||
def get_scenario(self, name):
|
|
||||||
if self.all_scenarios:
|
|
||||||
return [scenario for scenario in self.all_scenarios if scenario.name == name][0]
|
|
||||||
|
|
||||||
scenario_defs = os.path.join(self.config.main_dir, "scenarios.def")
|
scenario_defs = os.path.join(self.config.main_dir, "scenarios.def")
|
||||||
try:
|
try:
|
||||||
subprocess.check_output([self.GST_VALIDATE_COMMAND,
|
subprocess.check_output([self.GST_VALIDATE_COMMAND,
|
||||||
|
@ -667,4 +666,14 @@ class ScenarioManager(Loggable):
|
||||||
self.all_scenarios.append(Scenario(section,
|
self.all_scenarios.append(Scenario(section,
|
||||||
config.items(section)))
|
config.items(section)))
|
||||||
|
|
||||||
return [scenario for scenario in self.all_scenarios if scenario.name == name][0]
|
self.discovered = True
|
||||||
|
|
||||||
|
def get_scenario(self, name):
|
||||||
|
if self.discovered is False:
|
||||||
|
self._discover_scenarios()
|
||||||
|
|
||||||
|
try:
|
||||||
|
return [scenario for scenario in self.all_scenarios if scenario.name == name][0]
|
||||||
|
except IndexError:
|
||||||
|
self.warning("Scenario: %s not found" % name)
|
||||||
|
return None
|
||||||
|
|
Loading…
Reference in a new issue