Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
bf7d6879
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,发现更多精彩内容 >>
未验证
提交
bf7d6879
编写于
8月 10, 2017
作者:
A
Amador Pahim
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'ldoktor-remove-lazy-property-from-test'
Signed-off-by:
N
Amador Pahim
<
apahim@redhat.com
>
上级
0d9c063c
f5ae8ed8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
20 deletion
+27
-20
avocado/core/test.py
avocado/core/test.py
+20
-13
examples/tests/synctest.py
examples/tests/synctest.py
+4
-4
examples/tests/trinity.py
examples/tests/trinity.py
+3
-3
未找到文件。
avocado/core/test.py
浏览文件 @
bf7d6879
...
...
@@ -243,6 +243,7 @@ class Test(unittest.TestCase):
self
.
__fail_reason
=
None
self
.
__fail_class
=
None
self
.
__traceback
=
None
self
.
__cache_dirs
=
None
# Is initialized lazily
self
.
__running
=
False
self
.
paused
=
False
...
...
@@ -250,6 +251,12 @@ class Test(unittest.TestCase):
self
.
__runner_queue
=
runner_queue
basename
=
(
os
.
path
.
basename
(
self
.
logdir
).
replace
(
':'
,
'_'
)
.
replace
(
';'
,
'_'
))
self
.
__workdir
=
utils_path
.
init_dir
(
data_dir
.
get_tmp_dir
(),
basename
)
self
.
__srcdir
=
utils_path
.
init_dir
(
self
.
workdir
,
'src'
)
unittest
.
TestCase
.
__init__
(
self
,
methodName
=
methodName
)
@
property
...
...
@@ -355,27 +362,27 @@ class Test(unittest.TestCase):
raise
EnvironmentError
(
msg
)
return
path
@
data_structures
.
LazyP
roperty
@
p
roperty
def
workdir
(
self
):
basename
=
(
os
.
path
.
basename
(
self
.
logdir
).
replace
(
':'
,
'_'
)
.
replace
(
';'
,
'_'
))
return
utils_path
.
init_dir
(
data_dir
.
get_tmp_dir
(),
basename
)
return
self
.
__workdir
@
data_structures
.
LazyP
roperty
@
p
roperty
def
srcdir
(
self
):
return
utils_path
.
init_dir
(
self
.
workdir
,
'src'
)
return
self
.
__srcdir
@
data_structures
.
LazyP
roperty
@
p
roperty
def
cache_dirs
(
self
):
"""
Returns a list of cache directories as set in config file.
"""
cache_dirs
=
settings
.
get_value
(
'datadir.paths'
,
'cache_dirs'
,
key_type
=
list
,
default
=
[])
datadir_cache
=
os
.
path
.
join
(
data_dir
.
get_data_dir
(),
'cache'
)
if
datadir_cache
not
in
cache_dirs
:
cache_dirs
.
append
(
datadir_cache
)
return
cache_dirs
if
self
.
__cache_dirs
is
None
:
cache_dirs
=
settings
.
get_value
(
'datadir.paths'
,
'cache_dirs'
,
key_type
=
list
,
default
=
[])
datadir_cache
=
os
.
path
.
join
(
data_dir
.
get_data_dir
(),
'cache'
)
if
datadir_cache
not
in
cache_dirs
:
cache_dirs
.
append
(
datadir_cache
)
self
.
__cache_dirs
=
cache_dirs
return
self
.
__cache_dirs
@
property
def
runner_queue
(
self
):
...
...
examples/tests/synctest.py
浏览文件 @
bf7d6879
...
...
@@ -28,19 +28,19 @@ class SyncTest(Test):
sync_tarball
=
self
.
params
.
get
(
'sync_tarball'
,
'*'
,
'synctest.tar.bz2'
)
tarball_path
=
os
.
path
.
join
(
self
.
datadir
,
sync_tarball
)
archive
.
extract
(
tarball_path
,
self
.
srcdir
)
self
.
srcdir
=
os
.
path
.
join
(
self
.
srcdir
,
'synctest'
)
srcdir
=
os
.
path
.
join
(
self
.
srcdir
,
'synctest'
)
os
.
chdir
(
srcdir
)
if
self
.
params
.
get
(
'debug_symbols'
,
default
=
True
):
build
.
make
(
s
elf
.
s
rcdir
,
build
.
make
(
srcdir
,
env
=
{
'CFLAGS'
:
'-g -O0'
},
extra_args
=
'synctest'
)
else
:
build
.
make
(
s
elf
.
s
rcdir
)
build
.
make
(
srcdir
)
def
test
(
self
):
"""
Execute synctest with the appropriate params.
"""
os
.
chdir
(
self
.
srcdir
)
path
=
os
.
path
.
join
(
os
.
getcwd
(),
'synctest'
)
cmd
=
(
'%s %s %s'
%
(
path
,
self
.
params
.
get
(
'sync_length'
,
default
=
100
),
...
...
examples/tests/trinity.py
浏览文件 @
bf7d6879
...
...
@@ -31,10 +31,10 @@ class TrinityTest(Test):
tarball
=
self
.
params
.
get
(
'tarball'
,
default
=
'trinity-1.5.tar.bz2'
)
tarball_path
=
os
.
path
.
join
(
self
.
datadir
,
tarball
)
archive
.
extract
(
tarball_path
,
self
.
srcdir
)
s
elf
.
s
rcdir
=
os
.
path
.
join
(
self
.
srcdir
,
'trinity-1.5'
)
os
.
chdir
(
s
elf
.
s
rcdir
)
srcdir
=
os
.
path
.
join
(
self
.
srcdir
,
'trinity-1.5'
)
os
.
chdir
(
srcdir
)
process
.
run
(
'./configure.sh'
)
build
.
make
(
s
elf
.
s
rcdir
)
build
.
make
(
srcdir
)
self
.
victims_path
=
data_factory
.
make_dir_and_populate
(
self
.
workdir
)
def
test
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录