Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
39d4e3e3
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,发现更多精彩内容 >>
未验证
提交
39d4e3e3
编写于
5月 22, 2017
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'ldoktor/loader-make-broken'
Signed-off-by:
N
Cleber Rosa
<
crosa@redhat.com
>
上级
15d3771b
582a864d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
18 addition
and
15 deletion
+18
-15
avocado/core/loader.py
avocado/core/loader.py
+18
-15
未找到文件。
avocado/core/loader.py
浏览文件 @
39d4e3e3
...
@@ -478,8 +478,8 @@ class FileLoader(TestLoader):
...
@@ -478,8 +478,8 @@ class FileLoader(TestLoader):
"""
"""
name
=
'file'
name
=
'file'
__not_test_str
=
(
"
: Does not look like an INSTRUMENTED test, nor is
"
__not_test_str
=
(
"
Does not look like an INSTRUMENTED test, nor is it
"
"
it
executable"
)
"executable"
)
def
__init__
(
self
,
args
,
extra_params
):
def
__init__
(
self
,
args
,
extra_params
):
test_type
=
extra_params
.
pop
(
'allowed_test_types'
,
None
)
test_type
=
extra_params
.
pop
(
'allowed_test_types'
,
None
)
...
@@ -725,8 +725,8 @@ class FileLoader(TestLoader):
...
@@ -725,8 +725,8 @@ class FileLoader(TestLoader):
else
:
else
:
# Module does not have an avocado test class inside, and
# Module does not have an avocado test class inside, and
# it's not executable. Not a Test.
# it's not executable. Not a Test.
return
make_broken
(
NotATest
,
return
make_broken
(
NotATest
,
test_path
,
test_path
+
self
.
__not_test_str
)
self
.
__not_test_str
)
# Since a lot of things can happen here, the broad exception is
# Since a lot of things can happen here, the broad exception is
# justified. The user will get it unadulterated anyway, and avocado
# justified. The user will get it unadulterated anyway, and avocado
...
@@ -739,15 +739,18 @@ class FileLoader(TestLoader):
...
@@ -739,15 +739,18 @@ class FileLoader(TestLoader):
# execute it.
# execute it.
return
self
.
_make_test
(
test
.
SimpleTest
,
test_path
)
return
self
.
_make_test
(
test
.
SimpleTest
,
test_path
)
else
:
else
:
return
make_broken
(
NotATest
,
test_path
+
self
.
__not_test_str
)
return
make_broken
(
NotATest
,
test_path
,
self
.
__not_test_str
)
@
staticmethod
@
staticmethod
def
_make_test
(
klass
,
uid
):
def
_make_test
(
klass
,
uid
,
description
=
None
):
"""
"""
Create test template
Create test template
:param klass: test class
:param klass: test class
:param uid: test uid (by default used as id and name)
:param uid: test uid (by default used as id and name)
:param description: Description appended to "uid" (for listing purpose)
"""
"""
if
description
:
uid
=
"%s: %s"
%
(
uid
,
description
)
return
[(
klass
,
{
'name'
:
uid
})]
return
[(
klass
,
{
'name'
:
uid
})]
def
_make_tests
(
self
,
test_path
,
list_non_tests
,
subtests_filter
=
None
):
def
_make_tests
(
self
,
test_path
,
list_non_tests
,
subtests_filter
=
None
):
...
@@ -757,7 +760,7 @@ class FileLoader(TestLoader):
...
@@ -757,7 +760,7 @@ class FileLoader(TestLoader):
:param list_non_tests: include bad tests (NotATest, BrokenSymlink,...)
:param list_non_tests: include bad tests (NotATest, BrokenSymlink,...)
:param subtests_filter: optional filter of methods for avocado tests
:param subtests_filter: optional filter of methods for avocado tests
"""
"""
def
ignore_broken
(
klass
,
uid
,
params
=
None
):
def
ignore_broken
(
klass
,
uid
,
description
=
None
):
""" Always return empty list """
""" Always return empty list """
return
[]
return
[]
...
@@ -768,7 +771,7 @@ class FileLoader(TestLoader):
...
@@ -768,7 +771,7 @@ class FileLoader(TestLoader):
test_name
=
test_path
test_name
=
test_path
if
os
.
path
.
exists
(
test_path
):
if
os
.
path
.
exists
(
test_path
):
if
os
.
access
(
test_path
,
os
.
R_OK
)
is
False
:
if
os
.
access
(
test_path
,
os
.
R_OK
)
is
False
:
return
make_broken
(
AccessDeniedPath
,
test_path
+
":
Is not "
return
make_broken
(
AccessDeniedPath
,
test_path
,
"
Is not "
"readable"
)
"readable"
)
path_analyzer
=
path
.
PathInspector
(
test_path
)
path_analyzer
=
path
.
PathInspector
(
test_path
)
if
path_analyzer
.
is_python
():
if
path_analyzer
.
is_python
():
...
@@ -779,17 +782,17 @@ class FileLoader(TestLoader):
...
@@ -779,17 +782,17 @@ class FileLoader(TestLoader):
return
self
.
_make_test
(
test
.
SimpleTest
,
return
self
.
_make_test
(
test
.
SimpleTest
,
test_path
)
test_path
)
else
:
else
:
return
make_broken
(
NotATest
,
return
make_broken
(
NotATest
,
test_path
,
test_path
+
self
.
__not_test_str
)
self
.
__not_test_str
)
else
:
else
:
if
os
.
path
.
islink
(
test_path
):
if
os
.
path
.
islink
(
test_path
):
try
:
try
:
if
not
os
.
path
.
isfile
(
os
.
readlink
(
test_path
)):
if
not
os
.
path
.
isfile
(
os
.
readlink
(
test_path
)):
return
make_broken
(
BrokenSymlink
,
test_path
+
": Is
"
return
make_broken
(
BrokenSymlink
,
test_path
,
"Is a
"
"
a
broken symlink"
)
"broken symlink"
)
except
OSError
:
except
OSError
:
return
make_broken
(
AccessDeniedPath
,
test_path
+
": Is
"
return
make_broken
(
AccessDeniedPath
,
test_path
,
"Is not
"
"
not
accessible."
)
"accessible."
)
# Try to resolve test ID (keep compatibility)
# Try to resolve test ID (keep compatibility)
test_path
=
os
.
path
.
join
(
data_dir
.
get_test_dir
(),
test_name
)
test_path
=
os
.
path
.
join
(
data_dir
.
get_test_dir
(),
test_name
)
...
@@ -806,7 +809,7 @@ class FileLoader(TestLoader):
...
@@ -806,7 +809,7 @@ class FileLoader(TestLoader):
return
self
.
_make_avocado_tests
(
test_path
,
make_broken
,
return
self
.
_make_avocado_tests
(
test_path
,
make_broken
,
subtests_filter
,
subtests_filter
,
test_name
)
test_name
)
return
make_broken
(
NotATest
,
test_name
+
self
.
__not_test_str
)
return
make_broken
(
NotATest
,
test_name
,
self
.
__not_test_str
)
class
ExternalLoader
(
TestLoader
):
class
ExternalLoader
(
TestLoader
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录