From a5f0158abd6bc5313377abcfbbdafeaf4151d839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjell=20Hedstr=C3=B6m=20=3A=20Available=20for=20new=20Engi?= =?UTF-8?q?neering=20Leadership=20and=20Engineering=20Opportunities?= Date: Sun, 28 Jun 2020 07:54:53 -0600 Subject: [PATCH] speed up build (#367) by downloading gtest zip and avoiding cloning --- CMakeLists.txt.in | 3 +-- test_unit/test_sink.cpp | 12 +++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt.in b/CMakeLists.txt.in index 4b14f8d..4e93bdf 100644 --- a/CMakeLists.txt.in +++ b/CMakeLists.txt.in @@ -4,8 +4,7 @@ project(googletest-download NONE) include(ExternalProject) ExternalProject_Add(googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG master + URL https://github.com/google/googletest/archive/master.zip SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build" CONFIGURE_COMMAND "" diff --git a/test_unit/test_sink.cpp b/test_unit/test_sink.cpp index 1fe6585..434033f 100644 --- a/test_unit/test_sink.cpp +++ b/test_unit/test_sink.cpp @@ -67,7 +67,7 @@ TEST(Sink, OneSinkRemove) { } // just compile test -TEST(Sink, DefaultSinkRemove) { +TEST(Sink, DefaultSinkRemove){ using namespace g3; AtomicBoolPtr flag = make_shared < atomic> (false); AtomicIntPtr count = make_shared < atomic> (0); @@ -80,6 +80,16 @@ TEST(Sink, DefaultSinkRemove) { } } +TEST(Sink, NullSinkRemove) { + using namespace g3; + AtomicBoolPtr flag = make_shared < atomic> (false); + AtomicIntPtr count = make_shared < atomic> (0); + { + auto worker = g3::LogWorker::createLogWorker(); + std::unique_ptr> nullsink; + worker->removeSink(std::move(nullsink)); + } +}