-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhancement: enable common libraries UT
- Loading branch information
1 parent
16def19
commit 32bb6d4
Showing
60 changed files
with
382 additions
and
1,182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
cmake_minimum_required(VERSION 3.22) | ||
|
||
if(UNIT_TEST) | ||
project(byte_array_helper) | ||
|
||
include(../../cmake/CommonSettings.cmake) | ||
set_common_settings() | ||
|
||
add_definitions(-DPROMISE_TYPE=PromiseType::NORMAL) | ||
|
||
add_library(byte_array_helper INTERFACE) | ||
|
||
target_include_directories(byte_array_helper INTERFACE include) | ||
|
||
if(BUILD_TESTS) | ||
enable_testing() | ||
add_subdirectory(tests) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,18 @@ | ||
cmake_minimum_required(VERSION 3.22) | ||
|
||
project(utils_unit_test) | ||
|
||
file(GLOB UTIL_CXX_UNITTEST_WINDOWS_SRC) | ||
find_package(GTest CONFIG REQUIRED) | ||
|
||
file(GLOB UTIL_CXX_UNITTEST_COMMON_SRC | ||
"byteArrayHelper_test.cpp" | ||
"main.cpp" | ||
) | ||
|
||
file(GLOB UTIL_CXX_UNITTEST_LINUX_SRC) | ||
|
||
file(COPY input_files DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
link_directories(${SRC_FOLDER}/external/googletest/lib) | ||
link_directories(${SRC_FOLDER}/external/libarchive/.libs/) | ||
|
||
if(CMAKE_SYSTEM_NAME STREQUAL "HP-UX") | ||
add_definitions(-DPROMISE_TYPE=PromiseType::SLEEP) | ||
else() | ||
add_definitions(-DPROMISE_TYPE=PromiseType::NORMAL) | ||
endif(CMAKE_SYSTEM_NAME STREQUAL "HP-UX") | ||
|
||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows") | ||
add_executable(utils_unit_test | ||
${UTIL_CXX_UNITTEST_COMMON_SRC} | ||
${UTIL_CXX_UNITTEST_WINDOWS_SRC} | ||
${UTIL_CXX_UNITTEST_CPP17_SRC} | ||
) | ||
add_definitions(-DWIN32=1 | ||
-D_WIN32_WINNT=0x600) | ||
target_link_libraries(utils_unit_test | ||
debug gtestd | ||
debug gmockd | ||
optimized gtest | ||
optimized gmock | ||
pthread | ||
crypto | ||
ssl | ||
-static-libgcc | ||
ws2_32 | ||
crypt32 | ||
) | ||
else() | ||
|
||
if (APPLE) | ||
add_executable(utils_unit_test | ||
${UTIL_CXX_UNITTEST_COMMON_SRC} | ||
${UTIL_CXX_UNITTEST_CPP17_SRC} | ||
) | ||
else() | ||
add_executable(utils_unit_test | ||
${UTIL_CXX_UNITTEST_COMMON_SRC} | ||
${UTIL_CXX_UNITTEST_LINUX_SRC} | ||
${UTIL_CXX_UNITTEST_CPP17_SRC} | ||
) | ||
endif(APPLE) | ||
add_executable(byte_array_helper_tests | ||
${UTIL_CXX_UNITTEST_COMMON_SRC} | ||
) | ||
|
||
target_link_libraries(utils_unit_test | ||
debug gtestd | ||
debug gmockd | ||
optimized gtest | ||
optimized gmock | ||
rocksdb | ||
crypto | ||
dl | ||
pthread | ||
rt | ||
lzma | ||
z | ||
minizip | ||
archive | ||
) | ||
endif(CMAKE_SYSTEM_NAME STREQUAL "Windows") | ||
target_include_directories(byte_array_helper_tests PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR}/../include | ||
) | ||
|
||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
target_link_libraries(utils_unit_test -fprofile-arcs) | ||
else() | ||
target_link_libraries(utils_unit_test gcov) | ||
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
target_link_libraries(byte_array_helper_tests PRIVATE byte_array_helper GTest::gtest) | ||
|
||
add_test(NAME utils_unit_test | ||
COMMAND utils_unit_test) | ||
add_test(NAME byteArrayHelperTests COMMAND byte_array_helper_tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
cmake_minimum_required(VERSION 3.22) | ||
|
||
if(UNIT_TEST) | ||
project(cmd_helper) | ||
|
||
include(../../cmake/CommonSettings.cmake) | ||
set_common_settings() | ||
|
||
add_definitions(-DPROMISE_TYPE=PromiseType::NORMAL) | ||
|
||
add_library(cmd_helper INTERFACE) | ||
|
||
target_include_directories(cmd_helper INTERFACE include) | ||
|
||
if(BUILD_TESTS) | ||
enable_testing() | ||
add_subdirectory(tests) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,18 @@ | ||
cmake_minimum_required(VERSION 3.22) | ||
|
||
project(utils_unit_test) | ||
|
||
file(GLOB UTIL_CXX_UNITTEST_WINDOWS_SRC) | ||
find_package(GTest CONFIG REQUIRED) | ||
|
||
file(GLOB UTIL_CXX_UNITTEST_COMMON_SRC | ||
"cmdHelper_test.cpp" | ||
"main.cpp" | ||
) | ||
|
||
file(GLOB UTIL_CXX_UNITTEST_LINUX_SRC) | ||
|
||
file(COPY input_files DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
link_directories(${SRC_FOLDER}/external/googletest/lib) | ||
link_directories(${SRC_FOLDER}/external/libarchive/.libs/) | ||
|
||
if(CMAKE_SYSTEM_NAME STREQUAL "HP-UX") | ||
add_definitions(-DPROMISE_TYPE=PromiseType::SLEEP) | ||
else() | ||
add_definitions(-DPROMISE_TYPE=PromiseType::NORMAL) | ||
endif(CMAKE_SYSTEM_NAME STREQUAL "HP-UX") | ||
|
||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows") | ||
add_executable(utils_unit_test | ||
${UTIL_CXX_UNITTEST_COMMON_SRC} | ||
${UTIL_CXX_UNITTEST_WINDOWS_SRC} | ||
${UTIL_CXX_UNITTEST_CPP17_SRC} | ||
) | ||
add_definitions(-DWIN32=1 | ||
-D_WIN32_WINNT=0x600) | ||
target_link_libraries(utils_unit_test | ||
debug gtestd | ||
debug gmockd | ||
optimized gtest | ||
optimized gmock | ||
pthread | ||
crypto | ||
ssl | ||
-static-libgcc | ||
ws2_32 | ||
crypt32 | ||
) | ||
else() | ||
|
||
if (APPLE) | ||
add_executable(utils_unit_test | ||
${UTIL_CXX_UNITTEST_COMMON_SRC} | ||
${UTIL_CXX_UNITTEST_CPP17_SRC} | ||
) | ||
else() | ||
add_executable(utils_unit_test | ||
${UTIL_CXX_UNITTEST_COMMON_SRC} | ||
${UTIL_CXX_UNITTEST_LINUX_SRC} | ||
${UTIL_CXX_UNITTEST_CPP17_SRC} | ||
) | ||
endif(APPLE) | ||
add_executable(cmd_helper_tests | ||
${UTIL_CXX_UNITTEST_COMMON_SRC} | ||
) | ||
|
||
target_link_libraries(utils_unit_test | ||
debug gtestd | ||
debug gmockd | ||
optimized gtest | ||
optimized gmock | ||
rocksdb | ||
crypto | ||
dl | ||
pthread | ||
rt | ||
lzma | ||
z | ||
minizip | ||
archive | ||
) | ||
endif(CMAKE_SYSTEM_NAME STREQUAL "Windows") | ||
target_include_directories(cmd_helper_tests PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR}/../include | ||
) | ||
|
||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
target_link_libraries(utils_unit_test -fprofile-arcs) | ||
else() | ||
target_link_libraries(utils_unit_test gcov) | ||
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
target_link_libraries(cmd_helper_tests PRIVATE cmd_helper GTest::gtest) | ||
|
||
add_test(NAME utils_unit_test | ||
COMMAND utils_unit_test) | ||
add_test(NAME cmdHelperTests COMMAND cmd_helper_tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.