Signed-off-by: Tao He <sighingnow@gmail.com>
This commit is contained in:
Tao He 2023-03-05 21:37:43 +08:00
parent b9e5933851
commit a08a0b3aac
3 changed files with 13 additions and 2 deletions

View File

@ -6,6 +6,9 @@ concurrency:
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true cancel-in-progress: true
env:
SEGFAULT_SIGNALS: all
jobs: jobs:
build: build:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}

View File

@ -23,7 +23,15 @@ foreach(testfile ${TEST_FILES})
target_include_directories(${test_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../proto/gen) target_include_directories(${test_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../proto/gen)
target_include_directories(${test_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../proto/gen/proto) target_include_directories(${test_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../proto/gen/proto)
target_link_libraries(${test_name} etcd-cpp-api) target_link_libraries(${test_name} PRIVATE etcd-cpp-api)
if(UNIX AND NOT APPLE)
if(CMAKE_VERSION VERSION_LESS 3.13)
target_link_libraries(${test_name} PRIVATE -Wl,--no-as-needed -lSegFault -Wl,--as-needed)
else()
target_link_options(${test_name} PRIVATE -Wl,--no-as-needed -lSegFault -Wl,--as-needed)
endif()
endif()
add_dependencies(etcd_tests ${test_name}) add_dependencies(etcd_tests ${test_name})
endforeach() endforeach()

View File

@ -49,7 +49,7 @@ TEST_CASE("watch shouldn't leak memory")
// issue some changes to see if the watcher works // issue some changes to see if the watcher works
etcd::Client client(etcd_url); etcd::Client client(etcd_url);
std::unique_ptr<etcd::Watcher> watcher; std::unique_ptr<etcd::Watcher> watcher;
for (int round = 0; round < 1000; ++round) { for (int round = 0; round < 10 /* update this value to make it run for longer */; ++round) {
if (round % 50 == 0) { if (round % 50 == 0) {
std::cout << "starting round " << round << std::endl; std::cout << "starting round " << round << std::endl;
} }