Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
02c48ab7
Commit
02c48ab7
authored
Dec 12, 2014
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add CTest support to build tree
parent
d81d51d1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
15 deletions
+43
-15
CMakeLists.txt
CMakeLists.txt
+2
-0
OpenCVModule.cmake
cmake/OpenCVModule.cmake
+8
-12
OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+29
-0
CMakeLists.txt
modules/cudev/test/CMakeLists.txt
+1
-3
ts_func.cpp
modules/ts/src/ts_func.cpp
+3
-0
No files found.
CMakeLists.txt
View file @
02c48ab7
...
...
@@ -85,6 +85,8 @@ if(DEFINED CMAKE_BUILD_TYPE)
set_property
(
CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
${
CMAKE_CONFIGURATION_TYPES
}
)
endif
()
enable_testing
()
project
(
OpenCV CXX C
)
if
(
MSVC
)
...
...
cmake/OpenCVModule.cmake
View file @
02c48ab7
...
...
@@ -1008,6 +1008,12 @@ function(ocv_add_perf_tests)
if
(
NOT BUILD_opencv_world
)
_ocv_add_precompiled_headers
(
${
the_target
}
)
endif
()
ocv_add_test_from_target
(
"
${
the_target
}
"
"Performance"
"
${
the_target
}
"
)
ocv_add_test_from_target
(
"opencv_sanity_
${
name
}
"
"Sanity"
"
${
the_target
}
"
"--perf_min_samples=1"
"--perf_force_samples=1"
"--perf_verify_sanity"
)
else
(
OCV_DEPENDENCIES_FOUND
)
# TODO: warn about unsatisfied dependencies
endif
(
OCV_DEPENDENCIES_FOUND
)
...
...
@@ -1068,21 +1074,11 @@ function(ocv_add_accuracy_tests)
set_target_properties
(
${
the_target
}
PROPERTIES FOLDER
"tests accuracy"
)
endif
()
enable_testing
()
get_target_property
(
LOC
${
the_target
}
LOCATION
)
add_test
(
${
the_target
}
"
${
LOC
}
"
)
if
(
WINRT
)
# removing APPCONTAINER from tests to run from console
# look for detailed description inside of ocv_create_module macro above
add_custom_command
(
TARGET
"opencv_test_
${
name
}
"
POST_BUILD
COMMAND link.exe /edit /APPCONTAINER:NO $
(
TargetPath
))
endif
()
if
(
NOT BUILD_opencv_world
)
_ocv_add_precompiled_headers
(
${
the_target
}
)
endif
()
ocv_add_test_from_target
(
"
${
the_target
}
"
"Accuracy"
"
${
the_target
}
"
)
else
(
OCV_DEPENDENCIES_FOUND
)
# TODO: warn about unsatisfied dependencies
endif
(
OCV_DEPENDENCIES_FOUND
)
...
...
cmake/OpenCVUtils.cmake
View file @
02c48ab7
...
...
@@ -911,3 +911,32 @@ function(ocv_download)
set
(
DOWNLOAD_PACKAGE_LOCATION
${
DOWNLOAD_TARGET
}
PARENT_SCOPE
)
endfunction
()
function
(
ocv_add_test_from_target test_name test_kind the_target
)
if
(
CMAKE_VERSION VERSION_GREATER
"2.8"
AND NOT CMAKE_CROSSCOMPILING
)
if
(
NOT
"
${
test_kind
}
"
MATCHES
"^(Accuracy|Performance|Sanity)$"
)
message
(
FATAL_ERROR
"Unknown test kind :
${
test_kind
}
"
)
endif
()
if
(
NOT TARGET
"
${
the_target
}
"
)
message
(
FATAL_ERROR
"
${
the_target
}
is not a CMake target"
)
endif
()
string
(
TOLOWER
"
${
test_kind
}
"
test_kind_lower
)
set
(
test_report_dir
"
${
CMAKE_BINARY_DIR
}
/test-reports/
${
test_kind_lower
}
"
)
file
(
MAKE_DIRECTORY
"
${
test_report_dir
}
"
)
add_test
(
NAME
"
${
test_name
}
"
COMMAND
"
${
the_target
}
"
"--gtest_output=xml:
${
the_target
}
.xml"
${
ARGN
}
)
set_tests_properties
(
"
${
test_name
}
"
PROPERTIES
LABELS
"
${
OPENCV_MODULE_
${
the_module
}
_LABEL
}
;
${
test_kind
}
"
WORKING_DIRECTORY
"
${
test_report_dir
}
"
)
if
(
OPENCV_TEST_DATA_PATH
)
set_tests_properties
(
"
${
test_name
}
"
PROPERTIES
ENVIRONMENT
"OPENCV_TEST_DATA_PATH=
${
OPENCV_TEST_DATA_PATH
}
"
)
endif
()
endif
()
endfunction
()
modules/cudev/test/CMakeLists.txt
View file @
02c48ab7
...
...
@@ -46,9 +46,7 @@ if(OCV_DEPENDENCIES_FOUND)
set_target_properties
(
${
the_target
}
PROPERTIES FOLDER
"tests accuracy"
)
endif
()
enable_testing
()
get_target_property
(
LOC
${
the_target
}
LOCATION
)
add_test
(
${
the_target
}
"
${
LOC
}
"
)
ocv_add_test_from_target
(
"
${
the_target
}
"
"Accuracy"
"
${
the_target
}
"
)
if
(
INSTALL_TESTS
)
install
(
TARGETS
${
the_target
}
RUNTIME DESTINATION
${
OPENCV_TEST_INSTALL_PATH
}
COMPONENT tests
)
...
...
modules/ts/src/ts_func.cpp
View file @
02c48ab7
...
...
@@ -2951,6 +2951,9 @@ MatComparator::operator()(const char* expr1, const char* expr2,
void
printVersionInfo
(
bool
useStdOut
)
{
// Tell CTest not to discard any output
if
(
useStdOut
)
std
::
cout
<<
"CTEST_FULL_OUTPUT"
<<
std
::
endl
;
::
testing
::
Test
::
RecordProperty
(
"cv_version"
,
CV_VERSION
);
if
(
useStdOut
)
std
::
cout
<<
"OpenCV version: "
<<
CV_VERSION
<<
std
::
endl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment