Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
0b03fa54
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,发现更多精彩内容 >>
提交
0b03fa54
编写于
8月 19, 2014
作者:
L
Lucas Meneghel Rodrigues
提交者:
Lucas Meneghel Rodrigues
8月 19, 2014
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #150 from lmr/more-usability-fixes
More usability fixes
上级
f569ccd4
314ba686
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
7 deletion
+28
-7
avocado/cli/app.py
avocado/cli/app.py
+7
-1
avocado/plugins/runner.py
avocado/plugins/runner.py
+9
-5
selftests/all/functional/avocado/basic_tests.py
selftests/all/functional/avocado/basic_tests.py
+12
-1
未找到文件。
avocado/cli/app.py
浏览文件 @
0b03fa54
...
...
@@ -17,6 +17,7 @@ The core Avocado application.
"""
import
os
import
sys
from
argparse
import
ArgumentParser
...
...
@@ -64,7 +65,12 @@ class AvocadoApp(object):
description
=
'valid subcommands'
,
help
=
'subcommand help'
)
self
.
load_plugin_manager
(
args
.
plugins_dir
)
args
,
_
=
self
.
app_parser
.
parse_known_args
()
default_args
=
None
if
not
sys
.
argv
[
1
:]:
default_args
=
[
'--help'
]
args
,
_
=
self
.
app_parser
.
parse_known_args
(
args
=
default_args
)
self
.
plugin_manager
.
activate
(
args
)
self
.
args
=
self
.
app_parser
.
parse_args
()
...
...
avocado/plugins/runner.py
浏览文件 @
0b03fa54
...
...
@@ -96,11 +96,11 @@ class TestRunner(plugin.Plugin):
help
=
'Run a list of test modules or dropin tests (space separated)'
)
parser
.
add_argument
(
'url'
,
type
=
str
,
default
=
None
,
help
=
(
'
Test module names or paths to dropin tests '
'(space separated)'
)
)
help
=
(
'
List of test IDs (aliases or paths)'
),
nargs
=
'?'
)
parser
.
add_argument
(
'-z'
,
'--archive'
,
action
=
'store_true'
,
default
=
False
,
help
=
'Archive (ZIP) files generated by tests
.
'
)
help
=
'Archive (ZIP) files generated by tests'
)
parser
.
add_argument
(
'-m'
,
'--multiplex-file'
,
type
=
str
,
default
=
None
,
help
=
(
'Path to an avocado multiplex '
...
...
@@ -108,7 +108,7 @@ class TestRunner(plugin.Plugin):
nargs
=
'?'
)
parser
.
add_argument
(
'--keep-tmp-files'
,
action
=
'store_true'
,
default
=
False
,
help
=
'Keep temporary files generated by tests
.
'
)
help
=
'Keep temporary files generated by tests'
)
parser
.
add_argument
(
'--unique-id'
,
type
=
str
,
default
=
None
,
help
=
(
'Unique Job id. Used by a server when job '
...
...
@@ -116,6 +116,7 @@ class TestRunner(plugin.Plugin):
'different test machine'
))
parser
.
set_defaults
(
func
=
self
.
run_tests
)
self
.
parser
=
parser
self
.
configured
=
True
def
run_tests
(
self
,
args
):
...
...
@@ -125,7 +126,10 @@ class TestRunner(plugin.Plugin):
:param args: Command line args received from the run subparser.
"""
job_instance
=
job
.
Job
(
args
)
return
job_instance
.
run
()
rc
=
job_instance
.
run
()
if
args
.
url
is
None
:
self
.
parser
.
print_help
()
return
rc
class
SystemInformation
(
plugin
.
Plugin
):
...
...
selftests/all/functional/avocado/basic_tests.py
浏览文件 @
0b03fa54
...
...
@@ -154,14 +154,25 @@ class RunnerOperationTest(unittest.TestCase):
self
.
assertEqual
(
result
.
exit_status
,
expected_rc
)
self
.
assertEqual
(
result
.
stderr
,
expected_output
)
def
test_empty_args_list
(
self
):
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado'
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
expected_rc
=
0
unexpected_output
=
'too few arguments'
self
.
assertEqual
(
result
.
exit_status
,
expected_rc
)
self
.
assertNotIn
(
unexpected_output
,
result
.
stdout
)
def
test_empty_test_list
(
self
):
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run'
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
expected_rc
=
2
expected_output
=
'avocado run: error: too few arguments'
expected_output
=
'Empty test ID. A test path or alias must be provided'
expected_output_2
=
'usage:'
self
.
assertEqual
(
result
.
exit_status
,
expected_rc
)
self
.
assertIn
(
expected_output
,
result
.
stderr
)
self
.
assertIn
(
expected_output_2
,
result
.
stdout
)
def
test_not_found
(
self
):
os
.
chdir
(
basedir
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录