mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-02 10:13:51 +00:00
launcher: Minor indentation issue fixes
This commit is contained in:
parent
2b40c6c306
commit
cd1c4eb44d
1 changed files with 42 additions and 29 deletions
|
@ -384,15 +384,15 @@ class Test(Loggable):
|
||||||
vg_args = []
|
vg_args = []
|
||||||
|
|
||||||
for o, v in [('trace-children', 'yes'),
|
for o, v in [('trace-children', 'yes'),
|
||||||
('tool', 'memcheck'),
|
('tool', 'memcheck'),
|
||||||
('leak-check', 'full'),
|
('leak-check', 'full'),
|
||||||
('leak-resolution', 'high'),
|
('leak-resolution', 'high'),
|
||||||
# TODO: errors-for-leak-kinds should be set to all instead of definite
|
# TODO: errors-for-leak-kinds should be set to all instead of definite
|
||||||
# and all false positives should be added to suppression files.
|
# and all false positives should be added to suppression files.
|
||||||
('errors-for-leak-kinds', 'definite'),
|
('errors-for-leak-kinds', 'definite'),
|
||||||
('num-callers', '20'),
|
('num-callers', '20'),
|
||||||
('error-exitcode', str(VALGRIND_ERROR_CODE)),
|
('error-exitcode', str(VALGRIND_ERROR_CODE)),
|
||||||
('gen-suppressions', 'all')]:
|
('gen-suppressions', 'all')]:
|
||||||
vg_args.append("--%s=%s" % (o, v))
|
vg_args.append("--%s=%s" % (o, v))
|
||||||
|
|
||||||
if not self.options.redirect_logs:
|
if not self.options.redirect_logs:
|
||||||
|
@ -417,14 +417,16 @@ class Test(Loggable):
|
||||||
vg_config = get_data_file('data', 'valgrind.config')
|
vg_config = get_data_file('data', 'valgrind.config')
|
||||||
|
|
||||||
if self.proc_env.get('GST_VALIDATE_CONFIG'):
|
if self.proc_env.get('GST_VALIDATE_CONFIG'):
|
||||||
subenv['GST_VALIDATE_CONFIG'] = '%s%s%s' % (self.proc_env['GST_VALIDATE_CONFIG'], os.pathsep, vg_config)
|
subenv['GST_VALIDATE_CONFIG'] = '%s%s%s' % (
|
||||||
|
self.proc_env['GST_VALIDATE_CONFIG'], os.pathsep, vg_config)
|
||||||
else:
|
else:
|
||||||
subenv['GST_VALIDATE_CONFIG'] = vg_config
|
subenv['GST_VALIDATE_CONFIG'] = vg_config
|
||||||
|
|
||||||
if subenv == self.proc_env:
|
if subenv == self.proc_env:
|
||||||
self.add_env_variable('G_DEBUG', 'gc-friendly')
|
self.add_env_variable('G_DEBUG', 'gc-friendly')
|
||||||
self.add_env_variable('G_SLICE', 'always-malloc')
|
self.add_env_variable('G_SLICE', 'always-malloc')
|
||||||
self.add_env_variable('GST_VALIDATE_CONFIG', self.proc_env['GST_VALIDATE_CONFIG'])
|
self.add_env_variable('GST_VALIDATE_CONFIG',
|
||||||
|
self.proc_env['GST_VALIDATE_CONFIG'])
|
||||||
|
|
||||||
return command
|
return command
|
||||||
|
|
||||||
|
@ -535,9 +537,11 @@ class Test(Loggable):
|
||||||
|
|
||||||
return self.result
|
return self.result
|
||||||
|
|
||||||
|
|
||||||
class GstValidateTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
|
class GstValidateTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class GstValidateListener(socketserver.BaseRequestHandler):
|
class GstValidateListener(socketserver.BaseRequestHandler):
|
||||||
def handle(self):
|
def handle(self):
|
||||||
"""Implements BaseRequestHandler handle method"""
|
"""Implements BaseRequestHandler handle method"""
|
||||||
|
@ -564,13 +568,14 @@ class GstValidateListener(socketserver.BaseRequestHandler):
|
||||||
test = t
|
test = t
|
||||||
break
|
break
|
||||||
if test is None:
|
if test is None:
|
||||||
self.server.launcher.error("Could not find test for UUID %s" % uuid)
|
self.server.launcher.error(
|
||||||
|
"Could not find test for UUID %s" % uuid)
|
||||||
return
|
return
|
||||||
|
|
||||||
obj_type = obj.get("type", '')
|
obj_type = obj.get("type", '')
|
||||||
if obj_type == 'position':
|
if obj_type == 'position':
|
||||||
test.set_position(obj['position'], obj['duration'],
|
test.set_position(obj['position'], obj['duration'],
|
||||||
obj['speed'])
|
obj['speed'])
|
||||||
elif obj_type == 'buffering':
|
elif obj_type == 'buffering':
|
||||||
test.set_position(obj['position'], 100)
|
test.set_position(obj['position'], 100)
|
||||||
elif obj_type == 'action':
|
elif obj_type == 'action':
|
||||||
|
@ -674,7 +679,8 @@ class GstValidateTest(Test):
|
||||||
def get_override_file(self, media_descriptor):
|
def get_override_file(self, media_descriptor):
|
||||||
if media_descriptor:
|
if media_descriptor:
|
||||||
if media_descriptor.get_path():
|
if media_descriptor.get_path():
|
||||||
override_path = os.path.splitext(media_descriptor.get_path())[0] + VALIDATE_OVERRIDE_EXTENSION
|
override_path = os.path.splitext(media_descriptor.get_path())[
|
||||||
|
0] + VALIDATE_OVERRIDE_EXTENSION
|
||||||
if os.path.exists(override_path):
|
if os.path.exists(override_path):
|
||||||
return override_path
|
return override_path
|
||||||
|
|
||||||
|
@ -834,7 +840,7 @@ class GstValidateTest(Test):
|
||||||
for report in self.reports:
|
for report in self.reports:
|
||||||
if report.get('issue-id') == 'runtime::missing-plugin':
|
if report.get('issue-id') == 'runtime::missing-plugin':
|
||||||
self.set_result(Result.SKIPPED, "%s\n%s" % (report['summary'],
|
self.set_result(Result.SKIPPED, "%s\n%s" % (report['summary'],
|
||||||
report['details']))
|
report['details']))
|
||||||
return
|
return
|
||||||
|
|
||||||
self.debug("%s returncode: %s", self, self.process.returncode)
|
self.debug("%s returncode: %s", self, self.process.returncode)
|
||||||
|
@ -888,9 +894,9 @@ class GstValidateTest(Test):
|
||||||
msg += "(Expected errors not found: %s) " % mandatory_failures
|
msg += "(Expected errors not found: %s) " % mandatory_failures
|
||||||
result = Result.FAILED
|
result = Result.FAILED
|
||||||
elif self.expected_failures:
|
elif self.expected_failures:
|
||||||
msg += '%s(Expected errors occured: %s)%s' % (Colors.OKBLUE,
|
msg += '%s(Expected errors occured: %s)%s' % (Colors.OKBLUE,
|
||||||
self.expected_failures,
|
self.expected_failures,
|
||||||
Colors.ENDC)
|
Colors.ENDC)
|
||||||
|
|
||||||
self.set_result(result, msg.strip())
|
self.set_result(result, msg.strip())
|
||||||
|
|
||||||
|
@ -1319,7 +1325,8 @@ class _TestsLauncher(Loggable):
|
||||||
files = []
|
files = []
|
||||||
for f in files:
|
for f in files:
|
||||||
if f.endswith(".py"):
|
if f.endswith(".py"):
|
||||||
exec(compile(open(os.path.join(app_dir, f)).read(), os.path.join(app_dir, f), 'exec'), env)
|
exec(compile(open(os.path.join(app_dir, f)).read(),
|
||||||
|
os.path.join(app_dir, f), 'exec'), env)
|
||||||
|
|
||||||
def _exec_apps(self, env):
|
def _exec_apps(self, env):
|
||||||
app_dirs = self._list_app_dirs()
|
app_dirs = self._list_app_dirs()
|
||||||
|
@ -1364,14 +1371,15 @@ class _TestsLauncher(Loggable):
|
||||||
loaded_module = self._load_testsuite([testsuite])
|
loaded_module = self._load_testsuite([testsuite])
|
||||||
else:
|
else:
|
||||||
possible_testsuites_paths = [os.path.join(d, testsuite + ".py")
|
possible_testsuites_paths = [os.path.join(d, testsuite + ".py")
|
||||||
for d in self.options.testsuites_dirs]
|
for d in self.options.testsuites_dirs]
|
||||||
loaded_module = self._load_testsuite(possible_testsuites_paths)
|
loaded_module = self._load_testsuite(possible_testsuites_paths)
|
||||||
|
|
||||||
module = loaded_module[0]
|
module = loaded_module[0]
|
||||||
if not loaded_module[0]:
|
if not loaded_module[0]:
|
||||||
if "." in testsuite:
|
if "." in testsuite:
|
||||||
self.options.testsuites.append(testsuite.split('.')[0])
|
self.options.testsuites.append(testsuite.split('.')[0])
|
||||||
self.info("%s looks like a test name, trying that" % testsuite)
|
self.info("%s looks like a test name, trying that" %
|
||||||
|
testsuite)
|
||||||
self.options.wanted_tests.append(testsuite)
|
self.options.wanted_tests.append(testsuite)
|
||||||
else:
|
else:
|
||||||
printc("Could not load testsuite: %s, reasons: %s" % (
|
printc("Could not load testsuite: %s, reasons: %s" % (
|
||||||
|
@ -1426,7 +1434,8 @@ class _TestsLauncher(Loggable):
|
||||||
globals()["options"] = options
|
globals()["options"] = options
|
||||||
c__file__ = __file__
|
c__file__ = __file__
|
||||||
globals()["__file__"] = self.options.config
|
globals()["__file__"] = self.options.config
|
||||||
exec(compile(open(self.options.config).read(), self.options.config, 'exec'), globals())
|
exec(compile(open(self.options.config).read(),
|
||||||
|
self.options.config, 'exec'), globals())
|
||||||
globals()["__file__"] = c__file__
|
globals()["__file__"] = c__file__
|
||||||
|
|
||||||
def set_settings(self, options, args):
|
def set_settings(self, options, args):
|
||||||
|
@ -1512,7 +1521,7 @@ class _TestsLauncher(Loggable):
|
||||||
if not test.startswith('~'):
|
if not test.startswith('~'):
|
||||||
testlist_changed = True
|
testlist_changed = True
|
||||||
printc("Test %s Not in testsuite %s anymore"
|
printc("Test %s Not in testsuite %s anymore"
|
||||||
% (test, testsuite.__file__), Colors.FAIL)
|
% (test, testsuite.__file__), Colors.FAIL)
|
||||||
else:
|
else:
|
||||||
optional_out.append((test, None))
|
optional_out.append((test, None))
|
||||||
|
|
||||||
|
@ -1661,7 +1670,7 @@ class _TestsLauncher(Loggable):
|
||||||
res = test.test_end()
|
res = test.test_end()
|
||||||
self.reporter.after_test(test)
|
self.reporter.after_test(test)
|
||||||
if res != Result.PASSED and (self.options.forever or
|
if res != Result.PASSED and (self.options.forever or
|
||||||
self.options.fatal_error):
|
self.options.fatal_error):
|
||||||
return test.result
|
return test.result
|
||||||
if self.start_new_job(tests_left):
|
if self.start_new_job(tests_left):
|
||||||
jobs_running += 1
|
jobs_running += 1
|
||||||
|
@ -1999,7 +2008,8 @@ class MediaDescriptor(Loggable):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if self.is_live() and not scenario.compatible_with_live_content():
|
if self.is_live() and not scenario.compatible_with_live_content():
|
||||||
self.debug("Do not run %s as %s is a live content", scenario, self.get_uri())
|
self.debug("Do not run %s as %s is a live content",
|
||||||
|
scenario, self.get_uri())
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not self.prerrols() and getattr(scenario, 'needs_preroll', False):
|
if not self.prerrols() and getattr(scenario, 'needs_preroll', False):
|
||||||
|
@ -2044,9 +2054,10 @@ class GstValidateMediaDescriptor(MediaDescriptor):
|
||||||
Colors.FAIL)
|
Colors.FAIL)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
self._extract_data (media_xml)
|
self._extract_data(media_xml)
|
||||||
|
|
||||||
self.set_protocol(urllib.parse.urlparse(urllib.parse.urlparse(self.get_uri()).scheme).scheme)
|
self.set_protocol(urllib.parse.urlparse(
|
||||||
|
urllib.parse.urlparse(self.get_uri()).scheme).scheme)
|
||||||
|
|
||||||
def _extract_data(self, media_xml):
|
def _extract_data(self, media_xml):
|
||||||
# Extract the information we need from the xml
|
# Extract the information we need from the xml
|
||||||
|
@ -2058,7 +2069,8 @@ class GstValidateMediaDescriptor(MediaDescriptor):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
for stream in streams:
|
for stream in streams:
|
||||||
self._track_caps.append((stream.attrib["type"], stream.attrib["caps"]))
|
self._track_caps.append(
|
||||||
|
(stream.attrib["type"], stream.attrib["caps"]))
|
||||||
self._uri = media_xml.attrib["uri"]
|
self._uri = media_xml.attrib["uri"]
|
||||||
self._duration = int(media_xml.attrib["duration"])
|
self._duration = int(media_xml.attrib["duration"])
|
||||||
self._protocol = media_xml.get("protocol", None)
|
self._protocol = media_xml.get("protocol", None)
|
||||||
|
@ -2112,7 +2124,8 @@ class GstValidateMediaDescriptor(MediaDescriptor):
|
||||||
if verbose:
|
if verbose:
|
||||||
printc("Result: Failed", Colors.FAIL)
|
printc("Result: Failed", Colors.FAIL)
|
||||||
else:
|
else:
|
||||||
loggable.warning("GstValidateMediaDescriptor", "Exception: %s" % e)
|
loggable.warning("GstValidateMediaDescriptor",
|
||||||
|
"Exception: %s" % e)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
|
|
Loading…
Reference in a new issue