validate:tools: Enhance the way we detect if ges-launch can be used

We make sure it has been compiled against gst-validate
This commit is contained in:
Thibault Saunier 2014-01-09 16:57:54 +01:00
parent c7aa259c78
commit bd3aaded49
2 changed files with 15 additions and 5 deletions

View file

@ -19,6 +19,7 @@
import os
import urlparse
import subprocess
from urllib import unquote
from gi.repository import GES, Gst, GLib
from baseclasses import GstValidateTest, TestsManager
@ -166,10 +167,16 @@ class GESTestsManager(TestsManager):
def init(self):
if which(DEFAULT_GES_LAUNCH):
return True
return False
try:
if "--set-scenario=" in subprocess.check_output([DEFAULT_GES_LAUNCH, "--help"]):
return True
else:
self.warning("Can not use ges-launch, it seems not to be compiled against"
" gst-validate")
except subprocess.CalledProcessError as e:
self.warning("Can not use ges-launch: %s" % e)
except OSError as e:
self.warning("Can not use ges-launch: %s" % e)
def add_options(self, group):
group.add_option("-P", "--projects-paths", dest="projects_paths",

View file

@ -222,13 +222,16 @@ class GstValidateTest(Test):
))
class TestsManager(object):
class TestsManager(Loggable):
""" A class responsible for managing tests. """
name = ""
def __init__(self):
Loggable.__init__(self)
self.tests = []
self.options = None
self.args = None