Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
a9ddf121
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,发现更多精彩内容 >>
提交
a9ddf121
编写于
4月 12, 2019
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14078 from alalek:test_python_from_modules
上级
39630e07
a0a1fb5f
变更
18
显示空白变更内容
内联
并排
Showing
18 changed file
with
97 addition
and
2 deletion
+97
-2
cmake/OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+19
-0
doc/CMakeLists.txt
doc/CMakeLists.txt
+10
-1
modules/calib3d/misc/python/test/test_calibration.py
modules/calib3d/misc/python/test/test_calibration.py
+0
-0
modules/dnn/misc/python/test/test_dnn.py
modules/dnn/misc/python/test/test_dnn.py
+0
-0
modules/features2d/misc/python/test/test_feature_homography.py
...es/features2d/misc/python/test/test_feature_homography.py
+0
-0
modules/ml/misc/python/test/test_digits.py
modules/ml/misc/python/test/test_digits.py
+0
-0
modules/ml/misc/python/test/test_goodfeatures.py
modules/ml/misc/python/test/test_goodfeatures.py
+0
-0
modules/ml/misc/python/test/test_letter_recog.py
modules/ml/misc/python/test/test_letter_recog.py
+0
-0
modules/objdetect/misc/python/test/test_facedetect.py
modules/objdetect/misc/python/test/test_facedetect.py
+0
-0
modules/objdetect/misc/python/test/test_peopledetect.py
modules/objdetect/misc/python/test/test_peopledetect.py
+0
-0
modules/python/CMakeLists.txt
modules/python/CMakeLists.txt
+2
-0
modules/python/test/CMakeLists.txt
modules/python/test/CMakeLists.txt
+32
-0
modules/python/test/test.py
modules/python/test/test.py
+34
-1
modules/shape/misc/python/test/test_shape.py
modules/shape/misc/python/test/test_shape.py
+0
-0
modules/stitching/misc/python/test/test_stitching.py
modules/stitching/misc/python/test/test_stitching.py
+0
-0
modules/video/misc/python/test/test_lk_homography.py
modules/video/misc/python/test/test_lk_homography.py
+0
-0
modules/video/misc/python/test/test_lk_track.py
modules/video/misc/python/test/test_lk_track.py
+0
-0
modules/videoio/misc/python/test/test_videoio.py
modules/videoio/misc/python/test/test_videoio.py
+0
-0
未找到文件。
cmake/OpenCVUtils.cmake
浏览文件 @
a9ddf121
...
...
@@ -1777,3 +1777,22 @@ macro(ocv_git_describe var_name path)
set
(
${
var_name
}
"unknown"
)
endif
()
endmacro
()
# ocv_update_file(filepath content [VERBOSE])
# - write content to file
# - will not change modification time in case when file already exists and content has not changed
function
(
ocv_update_file filepath content
)
if
(
EXISTS
"
${
filepath
}
"
)
file
(
READ
"
${
filepath
}
"
actual_content
)
else
()
set
(
actual_content
""
)
endif
()
if
(
"
${
actual_content
}
"
STREQUAL
"
${
content
}
"
)
if
(
";
${
ARGN
}
;"
MATCHES
";VERBOSE;"
)
message
(
STATUS
"
${
filepath
}
contains the same content"
)
endif
()
else
()
file
(
WRITE
"
${
filepath
}
"
"
${
content
}
"
)
endif
()
endfunction
()
doc/CMakeLists.txt
浏览文件 @
a9ddf121
...
...
@@ -15,7 +15,7 @@ if(DOXYGEN_FOUND)
# not documented modules list
set
(
blacklist
"
${
DOXYGEN_BLACKLIST
}
"
)
list
(
APPEND blacklist
"ts"
"
java_bindings_generator"
"java"
"python_bindings_generator"
"python2"
"python3"
"js"
"
world"
)
list
(
APPEND blacklist
"ts"
"world"
)
unset
(
CMAKE_DOXYGEN_TUTORIAL_CONTRIB_ROOT
)
unset
(
CMAKE_DOXYGEN_TUTORIAL_JS_ROOT
)
...
...
@@ -32,7 +32,16 @@ if(DOXYGEN_FOUND)
set
(
refs_extra
)
set
(
deps
)
foreach
(
m
${
OPENCV_MODULES_MAIN
}
${
OPENCV_MODULES_EXTRA
}
)
set
(
the_module
"
${
m
}
"
)
if
(
NOT the_module MATCHES
"^opencv_"
)
set
(
the_module
"opencv_
${
m
}
"
)
endif
()
list
(
FIND blacklist
${
m
}
_pos
)
if
(
NOT EXISTS
"
${
OPENCV_MODULE_
${
the_module
}
_LOCATION
}
/include"
AND NOT EXISTS
"
${
OPENCV_MODULE_
${
the_module
}
_LOCATION
}
/doc"
)
set
(
_pos -2
)
# blacklist
endif
()
if
(
${
_pos
}
EQUAL -1
)
list
(
APPEND CMAKE_DOXYGEN_ENABLED_SECTIONS
"HAVE_opencv_
${
m
}
"
)
# include folder
...
...
modules/python/test/test_calibration.py
→
modules/
calib3d/misc/
python/test/test_calibration.py
浏览文件 @
a9ddf121
文件已移动
modules/python/test/test_dnn.py
→
modules/
dnn/misc/
python/test/test_dnn.py
浏览文件 @
a9ddf121
文件已移动
modules/python/test/test_feature_homography.py
→
modules/
features2d/misc/
python/test/test_feature_homography.py
浏览文件 @
a9ddf121
文件已移动
modules/python/test/test_digits.py
→
modules/
ml/misc/
python/test/test_digits.py
浏览文件 @
a9ddf121
文件已移动
modules/python/test/test_goodfeatures.py
→
modules/
ml/misc/
python/test/test_goodfeatures.py
浏览文件 @
a9ddf121
文件已移动
modules/python/test/test_letter_recog.py
→
modules/
ml/misc/
python/test/test_letter_recog.py
浏览文件 @
a9ddf121
文件已移动
modules/python/test/test_facedetect.py
→
modules/
objdetect/misc/
python/test/test_facedetect.py
浏览文件 @
a9ddf121
文件已移动
modules/python/test/test_peopledetect.py
→
modules/
objdetect/misc/
python/test/test_peopledetect.py
浏览文件 @
a9ddf121
文件已移动
modules/python/CMakeLists.txt
浏览文件 @
a9ddf121
...
...
@@ -18,6 +18,8 @@ endif()
add_subdirectory
(
bindings
)
add_subdirectory
(
test
)
if
(
NOT OPENCV_SKIP_PYTHON_LOADER
)
include
(
"./python_loader.cmake"
)
message
(
STATUS
"OpenCV Python: during development append to PYTHONPATH:
${
CMAKE_BINARY_DIR
}
/python_loader"
)
...
...
modules/python/test/CMakeLists.txt
0 → 100644
浏览文件 @
a9ddf121
set
(
MODULE_NAME
"python_tests"
)
set
(
OPENCV_MODULE_IS_PART_OF_WORLD FALSE
)
ocv_add_module
(
${
MODULE_NAME
}
INTERNAL
)
set
(
OPENCV_PYTHON_TESTS_CONFIG_FILE_DIR
"
${
OpenCV_BINARY_DIR
}
"
CACHE INTERNAL
""
)
set
(
OPENCV_PYTHON_TESTS_CONFIG_FILE
"
${
OPENCV_PYTHON_TESTS_CONFIG_FILE_DIR
}
/opencv_python_tests.cfg"
CACHE INTERNAL
""
)
# get list of modules to wrap
set
(
OPENCV_PYTHON_MODULES
)
foreach
(
m
${
OPENCV_MODULES_BUILD
}
)
if
(
";
${
OPENCV_MODULE_
${
m
}
_WRAPPERS
}
;"
MATCHES
";python.*;"
AND HAVE_
${
m
}
)
list
(
APPEND OPENCV_PYTHON_MODULES
${
m
}
)
#message(STATUS "\t${m}")
endif
()
endforeach
()
file
(
RELATIVE_PATH __loc_relative
"
${
OPENCV_PYTHON_TESTS_CONFIG_FILE_DIR
}
"
"
${
CMAKE_CURRENT_LIST_DIR
}
"
)
set
(
opencv_tests_locations
"
${
__loc_relative
}
"
)
foreach
(
m
${
OPENCV_PYTHON_MODULES
}
)
set
(
__loc
"
${
OPENCV_MODULE_
${
m
}
_LOCATION
}
/misc/python/test"
)
if
(
EXISTS
"
${
__loc
}
"
)
file
(
RELATIVE_PATH __loc_relative
"
${
OPENCV_PYTHON_TESTS_CONFIG_FILE_DIR
}
"
"
${
__loc
}
"
)
list
(
APPEND opencv_tests_locations
"
${
__loc_relative
}
"
)
endif
()
endforeach
(
m
)
string
(
REPLACE
";"
"
\n
"
opencv_tests_locations_
"
${
opencv_tests_locations
}
"
)
ocv_update_file
(
"
${
OPENCV_PYTHON_TESTS_CONFIG_FILE
}
"
"
${
opencv_tests_locations_
}
"
)
#
# TODO: Install rules (with test data?)
#
modules/python/test/test.py
浏览文件 @
a9ddf121
#!/usr/bin/env python
'''
Location of tests:
- <opencv_src>/modules/python/test
- <opencv_src>/modules/<module>/misc/python/test/
'''
from
__future__
import
print_function
...
...
@@ -20,7 +25,35 @@ from tests_common import NewOpenCVTests
basedir
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
def
load_tests
(
loader
,
tests
,
pattern
):
tests
.
addTests
(
loader
.
discover
(
basedir
,
pattern
=
os
.
environ
.
get
(
'OPENCV_PYTEST_FILTER'
,
'test_'
)
+
'*.py'
))
cwd
=
os
.
getcwd
()
config_file
=
'opencv_python_tests.cfg'
locations
=
[
cwd
,
basedir
]
if
os
.
path
.
exists
(
config_file
):
with
open
(
config_file
,
'r'
)
as
f
:
locations
+=
[
str
(
s
).
strip
()
for
s
in
f
.
readlines
()]
else
:
print
(
'WARNING: OpenCV tests config file ({}) is missing, running subset of tests'
.
format
(
config_file
))
tests_pattern
=
os
.
environ
.
get
(
'OPENCV_PYTEST_FILTER'
,
'test_'
)
+
'*.py'
if
tests_pattern
!=
'test_*py'
:
print
(
'Tests filter: {}'
.
format
(
tests_pattern
))
processed
=
set
()
for
l
in
locations
:
if
not
os
.
path
.
isabs
(
l
):
l
=
os
.
path
.
normpath
(
os
.
path
.
join
(
cwd
,
l
))
if
l
in
processed
:
continue
processed
.
add
(
l
)
print
(
'Discovering python tests from: {}'
.
format
(
l
))
sys_path_modify
=
l
not
in
sys
.
path
if
sys_path_modify
:
sys
.
path
.
append
(
l
)
# Hack python loader
discovered_tests
=
loader
.
discover
(
l
,
pattern
=
tests_pattern
,
top_level_dir
=
l
)
print
(
' found {} tests'
.
format
(
discovered_tests
.
countTestCases
()))
tests
.
addTests
(
loader
.
discover
(
l
,
pattern
=
tests_pattern
))
if
sys_path_modify
:
sys
.
path
.
remove
(
l
)
return
tests
if
__name__
==
'__main__'
:
...
...
modules/python/test/test_shape.py
→
modules/
shape/misc/
python/test/test_shape.py
浏览文件 @
a9ddf121
文件已移动
modules/python/test/test_stitching.py
→
modules/
stitching/misc/
python/test/test_stitching.py
浏览文件 @
a9ddf121
文件已移动
modules/python/test/test_lk_homography.py
→
modules/
video/misc/
python/test/test_lk_homography.py
浏览文件 @
a9ddf121
文件已移动
modules/python/test/test_lk_track.py
→
modules/
video/misc/
python/test/test_lk_track.py
浏览文件 @
a9ddf121
文件已移动
modules/python/test/test_videoio.py
→
modules/
videoio/misc/
python/test/test_videoio.py
浏览文件 @
a9ddf121
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录