Skip to content

Commit

Permalink
chore:为test添加分组
Browse files Browse the repository at this point in the history
  • Loading branch information
GengGode committed Dec 14, 2023
1 parent 1921896 commit 37f3618
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 15 deletions.
4 changes: 3 additions & 1 deletion tests/algorithms_direction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ get_filename_component(dir_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(test_name test_${dir_name})
add_executable(${test_name} main.cpp )
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS} fmt::fmt-header-only)
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/algorithms_feature_merge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ add_executable(${test_name} main.cpp
${SourceDir}/resources/binary/resources.binary.cpp
)
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS} fmt::fmt-header-only)
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/algorithms_features_erase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ ${SourceDir}/resources/resources.load.cpp
${SourceDir}/resources/binary/resources.binary.cpp
)
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS} cereal::cereal fmt::fmt-header-only)
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/algorithms_match_surf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ ${SourceDir}/resources/resources.load.cpp
${SourceDir}/resources/binary/resources.binary.cpp
)
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS} cereal::cereal fmt::fmt-header-only)
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/algorithms_rotation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ get_filename_component(dir_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(test_name test_${dir_name})
add_executable(${test_name} main.cpp )
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS} fmt::fmt-header-only)
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/api_GetCompileVersion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set(test_name test_${dir_name})
add_executable(${test_name} main.cpp)
include_directories(${IncludeDir})
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} cvAutoTrack)
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/binary_image/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ add_executable(${test_name} main.cpp ${SourceDir}/resources/binary/resources.bin
add_definitions(-DUSED_BINARY_IMAGE)
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS} fmt::fmt-header-only)
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/capture_scale/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ get_filename_component(dir_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(test_name test_${dir_name})
add_executable(${test_name} main.cpp)
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS})
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/container_treeset/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ ${SourceDir}/resources/resources.load.cpp
${SourceDir}/resources/binary/resources.binary.cpp
)
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS} cereal::cereal fmt::fmt-header-only)
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/curl_download_cache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ get_filename_component(dir_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(test_name test_${dir_name})
add_executable(${test_name} main.cpp)
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS})
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ get_filename_component(dir_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(test_name test_${dir_name})
add_executable(${test_name} main.cpp)
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS})
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/frame_capture_bitblt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ get_filename_component(dir_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(test_name test_${dir_name})
add_executable(${test_name} main.cpp)
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS})
add_test(NAME ${test_name} COMMAND ${test_name})
# copy opencv
Expand Down
4 changes: 3 additions & 1 deletion tests/frame_capture_window_graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ get_filename_component(dir_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(test_name test_${dir_name})
add_executable(${test_name} main.cpp)
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS})
add_test(NAME ${test_name} COMMAND ${test_name})
# copy opencv
Expand Down
4 changes: 3 additions & 1 deletion tests/impl_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set(test_name test_${dir_name})
add_executable(${test_name} main.cpp)
include_directories(${IncludeDir})
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS} cvAutoTrack fmt::fmt-header-only)
add_test(NAME ${test_name} COMMAND ${test_name})
4 changes: 3 additions & 1 deletion tests/xfeatures_perl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ get_filename_component(dir_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(test_name test_${dir_name})
add_executable(${test_name} main.cpp)
set_property(TARGET ${test_name} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${test_name} PROPERTIES FOLDER "tests")
string(REPLACE "_" ";" test_name_splits ${test_name})
list(GET test_name_splits 1 test_group_name)
set_target_properties(${test_name} PROPERTIES FOLDER "tests/${test_group_name}")
target_link_libraries(${test_name} ${OpenCV_LIBS})
add_test(NAME ${test_name} COMMAND ${test_name})

0 comments on commit 37f3618

Please sign in to comment.