parent
6ccc2161da
commit
6a489f52b3
|
|
@ -136,7 +136,6 @@ jobs:
|
|||
cmake .. -DCMAKE_CXX_STANDARD=17 \
|
||||
-DCMAKE_CXX_STANDARD_REQUIRED=TRUE \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
-DETCD_USE_ASAN=ON \
|
||||
-DBUILD_ETCD_TESTS=ON \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
|
|
@ -176,10 +175,13 @@ jobs:
|
|||
echo "Run the etcd election test ........................."
|
||||
./build/bin/ElectionTest
|
||||
|
||||
killall -TERM etcd || true
|
||||
sleep 5
|
||||
|
||||
- name: Lock Test
|
||||
if: false
|
||||
run: |
|
||||
killall -TERM etcd
|
||||
killall -TERM etcd || true
|
||||
sleep 5
|
||||
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/lib/x86_64-linux-gnu
|
||||
|
|
@ -195,6 +197,9 @@ jobs:
|
|||
echo "Run the etcd lock test ........................."
|
||||
./build/bin/LockTest
|
||||
|
||||
killall -TERM etcd || true
|
||||
sleep 5
|
||||
|
||||
- name: Lock Tests with Debug
|
||||
if: true
|
||||
uses: sighingnow/action-tmate@master
|
||||
|
|
@ -219,6 +224,9 @@ jobs:
|
|||
echo "Run the etcd lock test ........................."
|
||||
./build/bin/LockTest
|
||||
|
||||
killall -TERM etcd || true
|
||||
sleep 5
|
||||
|
||||
- name: Authentication Test
|
||||
run: |
|
||||
killall -TERM etcd || true
|
||||
|
|
@ -260,6 +268,9 @@ jobs:
|
|||
/usr/local/bin/etcdctl auth disable --user="root" --password="root" || true
|
||||
fi
|
||||
|
||||
killall -TERM etcd || true
|
||||
sleep 5
|
||||
|
||||
- name: Transport Security and Authentication Test
|
||||
run: |
|
||||
killall -TERM etcd || true
|
||||
|
|
|
|||
|
|
@ -30,27 +30,6 @@ option(BUILD_SHARED_LIBS "Build etcd-cpp-apiv3 shared libraries" ON)
|
|||
option(BUILD_ETCD_TESTS "Build etcd-cpp-apiv3 test cases" OFF)
|
||||
option(CMAKE_POSITION_INDEPENDENT_CODE "Build etcd-cpp-apiv3 with -fPIC" ON)
|
||||
option(ETCD_W_STRICT "Build etcd-cpp-apiv3 with -Werror" ON)
|
||||
option(ETCD_USE_ASAN "Using address sanitizer to check memory accessing" OFF)
|
||||
|
||||
macro(target_add_link_options target scope)
|
||||
set(options)
|
||||
set(oneValueArgs)
|
||||
set(multiValueArgs OPTIONS)
|
||||
cmake_parse_arguments(target_add_link_options "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.13")
|
||||
target_link_libraries(${target} INTERFACE ${target_add_link_options_OPTIONS})
|
||||
else()
|
||||
target_link_options(${target} ${scope} ${target_add_link_options_OPTIONS})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(target_enable_sanitizer target visibility)
|
||||
if(ETCD_USE_ASAN)
|
||||
message(STATUS "${target} will be bulit with -fsanitize=address")
|
||||
target_compile_options(${target} ${visibility} -fno-omit-frame-pointer -fsanitize=address)
|
||||
target_add_link_options(${target} ${visibility} OPTIONS -fsanitize=address)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# reference: https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling#always-full-rpath
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ file(GLOB_RECURSE CPP_CLIENT_CORE_SRC
|
|||
|
||||
add_library(etcd-cpp-api-core-objects OBJECT ${CPP_CLIENT_CORE_SRC} ${PROTOBUF_GENERATES})
|
||||
add_dependencies(etcd-cpp-api-core-objects protobuf_generates)
|
||||
target_enable_sanitizer(etcd-cpp-api-core-objects PUBLIC)
|
||||
include_generated_protobuf_files(etcd-cpp-api-core-objects)
|
||||
|
||||
# add the core library, includes the sycnhronous client only
|
||||
|
|
@ -30,7 +29,6 @@ target_link_libraries(etcd-cpp-api-core PUBLIC
|
|||
${OPENSSL_LIBRARIES}
|
||||
${GRPC_LIBRARIES}
|
||||
)
|
||||
target_enable_sanitizer(etcd-cpp-api-core PUBLIC)
|
||||
include_generated_protobuf_files(etcd-cpp-api-core)
|
||||
|
||||
# add the client with asynchronus client
|
||||
|
|
@ -43,7 +41,6 @@ target_link_libraries(etcd-cpp-api PUBLIC
|
|||
${OPENSSL_LIBRARIES}
|
||||
${GRPC_LIBRARIES}
|
||||
)
|
||||
target_enable_sanitizer(etcd-cpp-api PUBLIC)
|
||||
include_generated_protobuf_files(etcd-cpp-api)
|
||||
|
||||
if("${CMAKE_VERSION}" VERSION_LESS "3.14")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ foreach(testfile ${TEST_FILES})
|
|||
else()
|
||||
add_executable(${test_name} EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/${testfile})
|
||||
endif()
|
||||
target_enable_sanitizer(${test_name} PUBLIC)
|
||||
add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
|
||||
|
||||
target_include_directories(${test_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../proto/gen)
|
||||
|
|
|
|||
Loading…
Reference in New Issue