Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
6f00e531
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6f00e531
编写于
10月 20, 2016
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ts: update run.py
Add information about python bindings
上级
422154dc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
54 addition
and
11 deletion
+54
-11
modules/ts/misc/run_suite.py
modules/ts/misc/run_suite.py
+34
-7
modules/ts/misc/run_utils.py
modules/ts/misc/run_utils.py
+20
-4
未找到文件。
modules/ts/misc/run_suite.py
浏览文件 @
6f00e531
...
...
@@ -85,8 +85,8 @@ class TestSuite(object):
return
set
(
res
)
def
isTest
(
self
,
fullpath
):
if
fullpath
==
"java"
:
return
True
if
fullpath
in
[
'java'
,
'python2'
,
'python3'
]
:
return
self
.
options
.
mode
==
'test'
if
not
os
.
path
.
isfile
(
fullpath
):
return
False
if
self
.
cache
.
getOS
()
==
"nt"
and
not
fullpath
.
endswith
(
".exe"
):
...
...
@@ -102,6 +102,14 @@ class TestSuite(object):
return
res
+
cmd
return
cmd
def
tryCommand
(
self
,
cmd
):
try
:
if
0
==
execute
(
cmd
,
cwd
=
workingDir
):
return
True
except
:
pass
return
False
def
runTest
(
self
,
path
,
logfile
,
workingDir
,
args
=
[]):
args
=
args
[:]
exe
=
os
.
path
.
abspath
(
path
)
...
...
@@ -109,6 +117,22 @@ class TestSuite(object):
cmd
=
[
self
.
cache
.
ant_executable
,
"-Dopencv.build.type=%s"
%
self
.
cache
.
build_type
,
"buildAndTest"
]
ret
=
execute
(
cmd
,
cwd
=
self
.
cache
.
java_test_binary_dir
+
"/.build"
)
return
None
,
ret
elif
path
in
[
'python2'
,
'python3'
]:
executable
=
os
.
getenv
(
'OPENCV_PYTHON_BINARY'
,
None
)
if
executable
is
None
:
executable
=
path
if
not
self
.
tryCommand
([
executable
,
'--version'
]):
executable
=
'python'
cmd
=
[
executable
,
self
.
cache
.
opencv_home
+
'/modules/python/test/test.py'
,
'--repo'
,
self
.
cache
.
opencv_home
,
'-v'
]
+
args
module_suffix
=
''
if
not
'Visual Studio'
in
self
.
cache
.
cmake_generator
else
'/'
+
self
.
cache
.
build_type
env
=
{}
env
[
'PYTHONPATH'
]
=
self
.
cache
.
opencv_build
+
'/lib'
+
module_suffix
+
os
.
pathsep
+
os
.
getenv
(
'PYTHONPATH'
,
''
)
if
self
.
cache
.
getOS
()
==
'nt'
:
env
[
'PATH'
]
=
self
.
cache
.
opencv_build
+
'/bin'
+
module_suffix
+
os
.
pathsep
+
os
.
getenv
(
'PATH'
,
''
)
else
:
env
[
'LD_LIBRARY_PATH'
]
=
self
.
cache
.
opencv_build
+
'/bin'
+
os
.
pathsep
+
os
.
getenv
(
'LD_LIBRARY_PATH'
,
''
)
ret
=
execute
(
cmd
,
cwd
=
workingDir
,
env
=
env
)
return
None
,
ret
else
:
if
isColorEnabled
(
args
):
args
.
append
(
"--gtest_color=yes"
)
...
...
@@ -140,12 +164,15 @@ class TestSuite(object):
more_args
=
[]
exe
=
self
.
getTest
(
test
)
userlog
=
[
a
for
a
in
args
if
a
.
startswith
(
"--gtest_output="
)]
if
len
(
userlog
)
==
0
:
logname
=
self
.
getLogName
(
exe
,
date
)
more_args
.
append
(
"--gtest_output=xml:"
+
logname
)
if
exe
in
[
"java"
,
"python2"
,
"python3"
]:
logname
=
None
else
:
logname
=
userlog
[
0
][
userlog
[
0
].
find
(
":"
)
+
1
:]
userlog
=
[
a
for
a
in
args
if
a
.
startswith
(
"--gtest_output="
)]
if
len
(
userlog
)
==
0
:
logname
=
self
.
getLogName
(
exe
,
date
)
more_args
.
append
(
"--gtest_output=xml:"
+
logname
)
else
:
logname
=
userlog
[
0
][
userlog
[
0
].
find
(
":"
)
+
1
:]
log
.
debug
(
"Running the test: %s (%s) ==> %s in %s"
,
exe
,
args
+
more_args
,
logname
,
workingDir
)
if
self
.
options
.
dry_run
:
...
...
modules/ts/misc/run_utils.py
浏览文件 @
6f00e531
...
...
@@ -22,13 +22,17 @@ class Err(Exception):
def
__init__
(
self
,
msg
,
*
args
):
self
.
msg
=
msg
%
args
def
execute
(
cmd
,
silent
=
False
,
cwd
=
"."
):
def
execute
(
cmd
,
silent
=
False
,
cwd
=
"."
,
env
=
None
):
try
:
log
.
debug
(
"Run: %s"
,
cmd
)
if
env
:
for
k
in
env
:
log
.
debug
(
" Environ: %s=%s"
,
k
,
env
[
k
])
env
=
os
.
environ
.
update
(
env
)
if
silent
:
return
check_output
(
cmd
,
stderr
=
STDOUT
,
cwd
=
cwd
).
decode
(
"latin-1"
)
return
check_output
(
cmd
,
stderr
=
STDOUT
,
cwd
=
cwd
,
env
=
env
).
decode
(
"latin-1"
)
else
:
return
check_call
(
cmd
,
cwd
=
cwd
)
return
check_call
(
cmd
,
cwd
=
cwd
,
env
=
env
)
except
CalledProcessError
as
e
:
if
silent
:
log
.
debug
(
"Process returned: %d"
,
e
.
returncode
)
...
...
@@ -171,6 +175,8 @@ parse_patterns = (
{
'name'
:
"cuda_library"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
r
"^CUDA_CUDA_LIBRARY:FILEPATH=(.+)$"
)},
{
'name'
:
"cuda_version"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
r
"^CUDA_VERSION:STRING=(.+)$"
)},
{
'name'
:
"core_dependencies"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
r
"^opencv_core_LIB_DEPENDS:STATIC=(.+)$"
)},
{
'name'
:
"python2"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
r
"^BUILD_opencv_python2:BOOL=(.*)$"
)},
{
'name'
:
"python3"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
r
"^BUILD_opencv_python3:BOOL=(.*)$"
)},
)
class
CMakeCache
:
...
...
@@ -247,11 +253,15 @@ class CMakeCache:
files
=
glob
.
glob
(
os
.
path
.
join
(
d
,
mask
))
if
not
self
.
getOS
()
==
"android"
and
self
.
withJava
():
files
.
append
(
"java"
)
if
self
.
withPython2
():
files
.
append
(
"python2"
)
if
self
.
withPython3
():
files
.
append
(
"python3"
)
return
[
f
for
f
in
files
if
isGood
(
f
)]
return
[]
def
isMainModule
(
self
,
name
):
return
name
in
self
.
main_modules
return
name
in
self
.
main_modules
+
[
'python2'
,
'python3'
]
def
withCuda
(
self
):
return
self
.
cuda_version
and
self
.
with_cuda
==
"ON"
and
self
.
cuda_library
and
not
self
.
cuda_library
.
endswith
(
"-NOTFOUND"
)
...
...
@@ -259,6 +269,12 @@ class CMakeCache:
def
withJava
(
self
):
return
self
.
ant_executable
and
self
.
java_test_binary_dir
def
withPython2
(
self
):
return
self
.
python2
==
'ON'
def
withPython3
(
self
):
return
self
.
python3
==
'ON'
def
getGitVersion
(
self
):
if
self
.
cmake_home_vcver
:
if
self
.
cmake_home_vcver
==
self
.
opencv_home_vcver
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录