Commit bf058729 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

added opencv_test_highgui

parent 5538e206
...@@ -353,3 +353,63 @@ install(TARGETS ${the_target} ...@@ -353,3 +353,63 @@ install(TARGETS ${the_target}
install(FILES ${highgui_ext_hdrs} install(FILES ${highgui_ext_hdrs}
DESTINATION include/opencv2/highgui DESTINATION include/opencv2/highgui
COMPONENT main) COMPONENT main)
############################# highgui tests ################################
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/test"
"${CMAKE_CURRENT_BINARY_DIR}")
set(test_deps opencv_ts opencv_highgui)
foreach(d ${test_deps})
if(${d} MATCHES "opencv_")
string(REPLACE "opencv_" "${CMAKE_CURRENT_SOURCE_DIR}/../" d_dir ${d})
include_directories("${d_dir}/include")
endif()
endforeach()
file(GLOB test_srcs "test/*.cpp")
file(GLOB test_hdrs "test/*.h*")
source_group("Src" FILES ${test_srcs})
source_group("Include" FILES ${test_hdrs})
set(the_target "opencv_test_highgui")
add_executable(${the_target} ${test_srcs} ${test_hdrs})
if(PCHSupport_FOUND AND USE_PRECOMPILED_HEADERS)
set(pch_header ${CMAKE_CURRENT_SOURCE_DIR}/test/test_precomp.hpp)
if(${CMAKE_GENERATOR} MATCHES "Visual*" OR ${CMAKE_GENERATOR} MATCHES "Xcode*")
if(${CMAKE_GENERATOR} MATCHES "Visual*")
set(${the_target}_pch "test/test_precomp.cpp")
endif()
add_native_precompiled_header(${the_target} ${pch_header})
elseif(CMAKE_COMPILER_IS_GNUCXX AND ${CMAKE_GENERATOR} MATCHES ".*Makefiles")
add_precompiled_header(${the_target} ${pch_header})
endif()
endif()
# Additional target properties
set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
RUNTIME_OUTPUT_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}"
)
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${the_target} PROPERTIES FOLDER "tests")
endif()
add_dependencies(${the_target} ${test_deps})
# Add the required libraries for linking:
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${test_deps})
enable_testing()
get_target_property(LOC ${the_target} LOCATION)
add_test(${the_target} "${LOC}")
if(WIN32)
install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)
endif()
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#include "test_precomp.hpp" #include "test_precomp.hpp"
#if 0
using namespace cv; using namespace cv;
//#define DRAW_TEST_IMAGE //#define DRAW_TEST_IMAGE
...@@ -408,3 +410,5 @@ int CV_DrawingTest_C::checkLineIterator( Mat& _img ) ...@@ -408,3 +410,5 @@ int CV_DrawingTest_C::checkLineIterator( Mat& _img )
CV_DrawingTest_CPP drawing_test_cpp; CV_DrawingTest_CPP drawing_test_cpp;
CV_DrawingTest_C drawing_test_c; CV_DrawingTest_C drawing_test_c;
#endif
...@@ -40,7 +40,9 @@ ...@@ -40,7 +40,9 @@
// //
//M*/ //M*/
#include "cvtest.h" #include "test_precomp.hpp"
#if 0
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
...@@ -103,5 +105,6 @@ void CV_HighGuiOnlyGuiTest::run( int /*start_from */) ...@@ -103,5 +105,6 @@ void CV_HighGuiOnlyGuiTest::run( int /*start_from */)
} }
CV_HighGuiOnlyGuiTest highGuiOnlyGui_test; CV_HighGuiOnlyGuiTest highGuiOnlyGui_test;
#endif
#include "test_precomp.hpp" #include "test_precomp.hpp"
#include "opencv2/ts/ts_main.hpp"
CV_TEST_MAIN("cv")
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "opencv2/ts/ts.hpp" #include "opencv2/ts/ts.hpp"
#include "opencv2/imgproc/imgproc.hpp" #include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core/imgproc_c.h" #include "opencv2/imgproc/imgproc_c.h"
#include <iostream> #include <iostream>
#endif #endif
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
#include "test_precomp.hpp" #include "test_precomp.hpp"
#if 0
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
...@@ -310,3 +312,5 @@ CV_HighGuiTest HighGui_test; ...@@ -310,3 +312,5 @@ CV_HighGuiTest HighGui_test;
#endif #endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment