未验证 提交 ea947b23 编写于 作者: A Amador Pahim

Merge branch 'clebergnu-glib_dont_run'

Signed-off-by: NAmador Pahim <apahim@redhat.com>
...@@ -16,8 +16,10 @@ ...@@ -16,8 +16,10 @@
Plugin to run GLib Test Framework tests in Avocado Plugin to run GLib Test Framework tests in Avocado
""" """
import os
import re import re
from avocado.utils import path
from avocado.utils import process from avocado.utils import process
from avocado.core import loader from avocado.core import loader
...@@ -82,21 +84,24 @@ class GLibLoader(loader.TestLoader): ...@@ -82,21 +84,24 @@ class GLibLoader(loader.TestLoader):
if ':' in reference: if ':' in reference:
reference, _subtests_filter = reference.split(':', 1) reference, _subtests_filter = reference.split(':', 1)
subtests_filter = re.compile(_subtests_filter) subtests_filter = re.compile(_subtests_filter)
try:
cmd = '%s -l' % (reference)
result = process.run(cmd)
except Exception as details:
if which_tests == loader.ALL:
return [(NotGLibTest,
{"name": "%s: %s" % (reference, details)})]
return []
for test in result.stdout.splitlines(): if (os.path.isfile(reference) and
test_name = "%s:%s" % (reference, test) path.PathInspector(reference).has_exec_permission()):
if subtests_filter and not subtests_filter.search(test_name): try:
continue cmd = '%s -l' % (reference)
avocado_suite.append((GLibTest, {'name': test_name, result = process.run(cmd)
'executable': test_name})) except Exception as details:
if which_tests == loader.ALL:
return [(NotGLibTest,
{"name": "%s: %s" % (reference, details)})]
return []
for test in result.stdout.splitlines():
test_name = "%s:%s" % (reference, test)
if subtests_filter and not subtests_filter.search(test_name):
continue
avocado_suite.append((GLibTest, {'name': test_name,
'executable': test_name}))
if which_tests is loader.ALL and not avocado_suite: if which_tests is loader.ALL and not avocado_suite:
return [(NotGLibTest, return [(NotGLibTest,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册