Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
6aaa6a50
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
6aaa6a50
编写于
4月 01, 2015
作者:
V
Vadim Pisarevsky
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3887 from MSOpenTech:update_py_script
上级
80c79d40
ae090fe1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
45 addition
and
1 deletion
+45
-1
modules/ts/misc/run.py
modules/ts/misc/run.py
+45
-1
未找到文件。
modules/ts/misc/run.py
浏览文件 @
6aaa6a50
...
...
@@ -850,12 +850,51 @@ def getRunArgs(args):
path
=
npath
return
run_args
if
hostos
==
"nt"
:
def
moveTests
(
instance
,
destination
):
src
=
os
.
path
.
dirname
(
instance
.
tests_dir
)
# new binaries path
newBinPath
=
os
.
path
.
join
(
destination
,
"bin"
)
try
:
# copy binaries and CMakeCache.txt to the specified destination
shutil
.
copytree
(
src
,
newBinPath
)
shutil
.
copy
(
os
.
path
.
join
(
instance
.
path
,
"CMakeCache.txt"
),
os
.
path
.
join
(
destination
,
"CMakeCache.txt"
))
except
Exception
,
e
:
print
"Copying error occurred:"
,
str
(
e
)
exit
(
e
.
errno
)
# pattern of CMakeCache.txt string to be replaced
replacePattern
=
re
.
compile
(
"EXECUTABLE_OUTPUT_PATH:PATH=(.+)"
)
with
open
(
os
.
path
.
join
(
destination
,
"CMakeCache.txt"
),
"r"
)
as
cachefile
:
try
:
cachedata
=
cachefile
.
read
()
if
hostos
==
'nt'
:
# fix path slashes on nt systems
newBinPath
=
re
.
sub
(
r
"\\"
,
r
"/"
,
newBinPath
)
# replace old binaries path in CMakeCache.txt
cachedata
=
re
.
sub
(
re
.
search
(
replacePattern
,
cachedata
).
group
(
1
),
newBinPath
,
cachedata
)
except
Exception
,
e
:
print
"Reading error occurred:"
,
str
(
e
)
exit
(
e
.
errno
)
with
open
(
os
.
path
.
join
(
destination
,
"CMakeCache.txt"
),
"w"
)
as
cachefile
:
try
:
cachefile
.
write
(
cachedata
)
except
Exception
,
e
:
print
"Writing error occurred:"
,
str
(
e
)
exit
(
e
.
errno
)
exit
()
if
__name__
==
"__main__"
:
test_args
=
[
a
for
a
in
sys
.
argv
if
a
.
startswith
(
"--perf_"
)
or
a
.
startswith
(
"--gtest_"
)]
argv
=
[
a
for
a
in
sys
.
argv
if
not
(
a
.
startswith
(
"--perf_"
)
or
a
.
startswith
(
"--gtest_"
))]
parser
=
OptionParser
()
parser
=
OptionParser
(
usage
=
"run.py [options] [build_path]"
,
description
=
"Note: build_path is required if running not from CMake build directory"
)
parser
.
add_option
(
"-t"
,
"--tests"
,
dest
=
"tests"
,
help
=
"comma-separated list of modules to test"
,
metavar
=
"SUITS"
,
default
=
""
)
if
hostos
==
"nt"
:
parser
.
add_option
(
"-m"
,
"--move_tests"
,
dest
=
"move"
,
help
=
"location to move current tests build"
,
metavar
=
"PATH"
,
default
=
""
)
parser
.
add_option
(
"-w"
,
"--cwd"
,
dest
=
"cwd"
,
help
=
"working directory for tests"
,
metavar
=
"PATH"
,
default
=
"."
)
parser
.
add_option
(
"-a"
,
"--accuracy"
,
dest
=
"accuracy"
,
help
=
"look for accuracy tests instead of performance tests"
,
action
=
"store_true"
,
default
=
False
)
parser
.
add_option
(
"-l"
,
"--longname"
,
dest
=
"useLongNames"
,
action
=
"store_true"
,
help
=
"generate log files with long names"
,
default
=
False
)
...
...
@@ -880,6 +919,7 @@ if __name__ == "__main__":
if
len
(
run_args
)
==
0
:
print
>>
sys
.
stderr
,
"Usage:"
,
os
.
path
.
basename
(
sys
.
argv
[
0
]),
"[options] [build_path]"
print
>>
sys
.
stderr
,
"Please specify build_path or run script from CMake build directory"
exit
(
1
)
options
.
android_env
=
{}
...
...
@@ -906,6 +946,10 @@ if __name__ == "__main__":
test_list
=
[]
for
path
in
run_args
:
suite
=
TestSuite
(
options
,
path
)
if
hostos
==
"nt"
:
if
(
options
.
move
):
moveTests
(
suite
,
options
.
move
)
#print vars(suite),"\n"
if
options
.
list
:
test_list
.
extend
(
suite
.
tests
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录