Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
b7caac5d
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b7caac5d
编写于
3月 14, 2014
作者:
L
Lucas Meneghel Rodrigues
提交者:
Lucas Meneghel Rodrigues
3月 14, 2014
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2 from ruda/moreplugins
Make sysinfo into a runner Plugin.
上级
1457eac2
687b9adf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
14 deletion
+30
-14
avocado/cli/app.py
avocado/cli/app.py
+4
-10
avocado/plugins/builtin.py
avocado/plugins/builtin.py
+1
-0
avocado/plugins/runner.py
avocado/plugins/runner.py
+23
-3
scripts/avocado
scripts/avocado
+2
-1
未找到文件。
avocado/cli/app.py
浏览文件 @
b7caac5d
"""
Implements the base avocado runner
application.
The core Avocado
application.
"""
import
imp
import
logging
import
os
...
...
@@ -11,10 +12,10 @@ from avocado import sysinfo
from
avocado.plugins.manager
import
get_plugin_manager
class
Avocado
Runner
App
(
object
):
class
AvocadoApp
(
object
):
"""
Basic avocado runner
application.
Avocado
application.
"""
def
__init__
(
self
):
...
...
@@ -34,13 +35,6 @@ class AvocadoRunnerApp(object):
description
=
'valid subcommands'
,
help
=
'subcommand help'
)
psysinfo
=
subparsers
.
add_parser
(
'sysinfo'
,
help
=
'Collect system information'
)
psysinfo
.
add_argument
(
'sysinfodir'
,
type
=
str
,
help
=
'Dir where to dump sysinfo'
,
nargs
=
'?'
,
default
=
''
)
psysinfo
.
set_defaults
(
func
=
sysinfo
.
collect_sysinfo
)
self
.
load_plugin_manager
(
subparsers
)
self
.
args
=
self
.
arg_parser
.
parse_args
()
...
...
avocado/plugins/builtin.py
浏览文件 @
b7caac5d
...
...
@@ -5,6 +5,7 @@ from importlib import import_module
__all__
=
[
'load_builtins'
]
Builtins
=
[(
'avocado.plugins.runner'
,
'TestLister'
),
(
'avocado.plugins.runner'
,
'SystemInformation'
),
(
'avocado.plugins.runner'
,
'TestRunner'
),
]
...
...
avocado/plugins/runner.py
浏览文件 @
b7caac5d
...
...
@@ -26,9 +26,9 @@ class TestLister(plugin.Plugin):
:param parser: Main test runner parser.
"""
tlist
=
parser
.
add_parser
(
'list'
,
help
=
'List available test modules'
)
tlist
.
set_defaults
(
func
=
self
.
list_tests
)
myparser
=
parser
.
add_parser
(
'list'
,
help
=
'List available test modules'
)
myparser
.
set_defaults
(
func
=
self
.
list_tests
)
self
.
enabled
=
True
def
list_tests
(
self
,
args
):
...
...
@@ -66,6 +66,7 @@ class TestRunner(plugin.Plugin):
'(space separated)'
),
nargs
=
'?'
,
default
=
''
)
myparser
.
set_defaults
(
func
=
self
.
run_tests
)
self
.
enabled
=
True
def
run_tests
(
self
,
args
):
"""
...
...
@@ -134,3 +135,22 @@ class TestRunner(plugin.Plugin):
test_index
+=
1
output_manager
.
stop_file_logging
()
class
SystemInformation
(
plugin
.
Plugin
):
"""
Collect system information and log.
"""
def
configure
(
self
,
parser
):
"""
Add the subparser for the run action.
:param parser: Main test runner parser.
"""
myparser
=
parser
.
add_parser
(
'sysinfo'
,
help
=
'Collect system information'
)
myparser
.
add_argument
(
'sysinfodir'
,
type
=
str
,
help
=
'Dir where to dump sysinfo'
,
nargs
=
'?'
,
default
=
''
)
myparser
.
set_defaults
(
func
=
sysinfo
.
collect_sysinfo
)
self
.
enabled
=
True
scripts/avocado
浏览文件 @
b7caac5d
#!/usr/bin/env python
import
os
import
sys
...
...
@@ -10,5 +11,5 @@ if os.path.isdir(os.path.join(basedir, 'avocado')):
import
avocado
if
__name__
==
'__main__'
:
app
=
avocado
.
cli
.
app
.
Avocado
Runner
App
()
app
=
avocado
.
cli
.
app
.
AvocadoApp
()
app
.
run
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录