[med-svn] [Git][med-team/spdlog][upstream] New upstream version 1.7.0+ds

Michael R. Crusoe gitlab at salsa.debian.org
Thu Jul 16 11:15:04 BST 2020



Michael R. Crusoe pushed to branch upstream at Debian Med / spdlog


Commits:
8c629bea by Michael R. Crusoe at 2020-07-16T12:05:19+02:00
New upstream version 1.7.0+ds
- - - - -


13 changed files:

- .travis.yml
- CMakeLists.txt
- README.md
- appveyor.yml
- bench/latency.cpp
- cmake/version.rc.in
- include/spdlog/details/fmt_helper.h
- include/spdlog/fmt/bin_to_hex.h
- include/spdlog/logger.h
- include/spdlog/spdlog.h
- include/spdlog/version.h
- tests/CMakeLists.txt
- tests/test_mpmc_q.cpp


Changes:

=====================================
.travis.yml
=====================================
@@ -101,10 +101,10 @@ script:
       -DCMAKE_CXX_STANDARD=$CPP \
       -DSPDLOG_BUILD_EXAMPLE=ON \
       -DSPDLOG_BUILD_EXAMPLE_HO=ON \
-      -DSPDLOG_ENABLE_WARNINGS=ON \
+      -DSPDLOG_BUILD_WARNINGS=ON \
       -DSPDLOG_BUILD_BENCH=OFF \
       -DSPDLOG_BUILD_TESTS=ON \
-      -DSPDLOG_BUILD_TESTS_HO=OFf \
+      -DSPDLOG_BUILD_TESTS_HO=OFF \
       -DSPDLOG_SANITIZE_ADDRESS=$ASAN 
       
   - make VERBOSE=1 -j2


=====================================
CMakeLists.txt
=====================================
@@ -131,16 +131,15 @@ if(NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO)
     list(APPEND SPDLOG_SRCS src/fmt.cpp)
 endif()
 
-if(WIN32 AND SPDLOG_BUILD_SHARED)
-    list(APPEND SPDLOG_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
-endif()
-
 if(SPDLOG_BUILD_SHARED)
+    if(WIN32)
+        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
+        list(APPEND SPDLOG_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
+    endif()
     add_library(spdlog SHARED ${SPDLOG_SRCS} ${SPDLOG_ALL_HEADERS})
     target_compile_definitions(spdlog PUBLIC SPDLOG_SHARED_LIB)
-    if(WIN32)
+    if(MSVC)
         target_compile_options(spdlog PUBLIC /wd4251 /wd4275)
-        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
     endif()
     if(NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO)
         target_compile_definitions(spdlog PRIVATE FMT_EXPORT PUBLIC FMT_SHARED)
@@ -200,49 +199,25 @@ endif()
 # ---------------------------------------------------------------------------------------
 # Misc definitions according to tweak options
 # ---------------------------------------------------------------------------------------
-if(SPDLOG_WCHAR_SUPPORT)
-    target_compile_definitions(spdlog PUBLIC SPDLOG_WCHAR_TO_UTF8_SUPPORT)
-    target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_WCHAR_TO_UTF8_SUPPORT)
-endif()
-
-if(SPDLOG_WCHAR_FILENAMES)
-    target_compile_definitions(spdlog PUBLIC SPDLOG_WCHAR_FILENAMES)
-    target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_WCHAR_FILENAMES)
-endif()
-
-if(SPDLOG_NO_EXCEPTIONS)
-    target_compile_definitions(spdlog PUBLIC SPDLOG_NO_EXCEPTIONS)
-
-    target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_NO_EXCEPTIONS)
-
-    if(NOT MSVC)
-        target_compile_options(spdlog PRIVATE -fno-exceptions)
+set(SPDLOG_WCHAR_TO_UTF8_SUPPORT ${SPDLOG_WCHAR_SUPPORT})
+foreach(SPDLOG_OPTION
+    SPDLOG_WCHAR_TO_UTF8_SUPPORT
+    SPDLOG_WCHAR_FILENAMES
+    SPDLOG_NO_EXCEPTIONS
+    SPDLOG_CLOCK_COARSE
+    SPDLOG_PREVENT_CHILD_FD
+    SPDLOG_NO_THREAD_ID
+    SPDLOG_NO_TLS
+    SPDLOG_NO_ATOMIC_LEVELS
+)
+    if(${SPDLOG_OPTION})
+        target_compile_definitions(spdlog PUBLIC ${SPDLOG_OPTION})
+        target_compile_definitions(spdlog_header_only INTERFACE ${SPDLOG_OPTION})
     endif()
-endif()
-
-if(SPDLOG_CLOCK_COARSE)
-    target_compile_definitions(spdlog PRIVATE SPDLOG_CLOCK_COARSE)
-    target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_CLOCK_COARSE)
-endif()
-
-if(SPDLOG_PREVENT_CHILD_FD)
-    target_compile_definitions(spdlog PRIVATE SPDLOG_PREVENT_CHILD_FD)
-    target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_PREVENT_CHILD_FD)
-endif()
-
-if(SPDLOG_NO_THREAD_ID)
-    target_compile_definitions(spdlog PRIVATE SPDLOG_NO_THREAD_ID)
-    target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_NO_THREAD_ID)
-endif()
-
-if(SPDLOG_NO_TLS)
-    target_compile_definitions(spdlog PRIVATE SPDLOG_NO_TLS)
-    target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_NO_TLS)
-endif()
+endforeach()
 
-if(SPDLOG_NO_ATOMIC_LEVELS)
-    target_compile_definitions(spdlog PUBLIC SPDLOG_NO_ATOMIC_LEVELS)
-    target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_NO_ATOMIC_LEVELS)
+if(SPDLOG_NO_EXCEPTIONS AND NOT MSVC)
+    target_compile_options(spdlog PRIVATE -fno-exceptions)
 endif()
 
 # ---------------------------------------------------------------------------------------


=====================================
README.md
=====================================
@@ -418,6 +418,6 @@ Documentation can be found in the [wiki](https://github.com/gabime/spdlog/wiki/1
 
 ---
 
-Thanks to [JetBrains](https://www.jetbrains.com/?from=spdlog) for donating licenses to their products to help developing **spdlog** <a href="https://www.jetbrains.com/?from=spdlog"><img src="logos/jetbrains-variant-4.svg" width="94" align="center" /></a>
+Thanks to [JetBrains](https://www.jetbrains.com/?from=spdlog) for donating product licenses to help develop **spdlog** <a href="https://www.jetbrains.com/?from=spdlog"><img src="logos/jetbrains-variant-4.svg" width="94" align="center" /></a>
 
 


=====================================
appveyor.yml
=====================================
@@ -40,7 +40,7 @@ build_script:
 
       set PATH=%PATH%;C:\Program Files\Git\usr\bin
 
-      cmake .. -G %GENERATOR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DSPDLOG_WCHAR_SUPPORT=%WCHAR% -DSPDLOG_BUILD_SHARED=%BUILD_SHARED% -DSPDLOG_BUILD_EXAMPLE=ON -DSPDLOG_BUILD_EXAMPLE_HO=ON -DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_TESTS_HO=OFF -DSPDLOG_ENABLE_WARNINGS=ON
+      cmake .. -G %GENERATOR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DSPDLOG_WCHAR_SUPPORT=%WCHAR% -DSPDLOG_BUILD_SHARED=%BUILD_SHARED% -DSPDLOG_BUILD_EXAMPLE=ON -DSPDLOG_BUILD_EXAMPLE_HO=ON -DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_TESTS_HO=OFF -DSPDLOG_BUILD_WARNINGS=ON
 
       cmake --build . --config %BUILD_TYPE%
 


=====================================
bench/latency.cpp
=====================================
@@ -39,6 +39,16 @@ void bench_logger(benchmark::State &state, std::shared_ptr<spdlog::logger> logge
     }
 }
 
+void bench_logger_fmt_string(benchmark::State &state, std::shared_ptr<spdlog::logger> logger)
+{
+    int i = 0;
+    for (auto _ : state)
+    {
+        logger->info(FMT_STRING("Hello logger: msg number {}..............."), ++i);
+        ;
+    }
+}
+
 void bench_disabled_macro(benchmark::State &state, std::shared_ptr<spdlog::logger> logger)
 {
     int i = 0;
@@ -88,6 +98,7 @@ int main(int argc, char *argv[])
     auto null_logger_st = std::make_shared<spdlog::logger>("bench", std::make_shared<null_sink_st>());
     benchmark::RegisterBenchmark("null_sink_st (500_bytes c_str)", bench_c_string, std::move(null_logger_st));
     benchmark::RegisterBenchmark("null_sink_st", bench_logger, null_logger_st);
+    benchmark::RegisterBenchmark("null_sink_fmt_string", bench_logger_fmt_string, null_logger_st);
     // with backtrace of 64
     auto tracing_null_logger_st = std::make_shared<spdlog::logger>("bench", std::make_shared<null_sink_st>());
     tracing_null_logger_st->enable_backtrace(64);


=====================================
cmake/version.rc.in
=====================================
@@ -1,5 +1,5 @@
 #define APSTUDIO_READONLY_SYMBOLS
-#include "winres.h"
+#include <windows.h>
 #undef APSTUDIO_READONLY_SYMBOLS
 
 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US


=====================================
include/spdlog/details/fmt_helper.h
=====================================
@@ -34,7 +34,15 @@ template<typename T>
 inline unsigned int count_digits(T n)
 {
     using count_type = typename std::conditional<(sizeof(T) > sizeof(uint32_t)), uint64_t, uint32_t>::type;
-    return static_cast<unsigned int>(fmt::internal::count_digits(static_cast<count_type>(n)));
+    return static_cast<unsigned int>(fmt::
+// fmt 7.0.0 renamed the internal namespace to detail.
+// See: https://github.com/fmtlib/fmt/issues/1538
+#if FMT_VERSION < 70000
+internal
+#else
+detail
+#endif
+::count_digits(static_cast<count_type>(n)));
 }
 
 inline void pad2(int n, memory_buf_t &dest)


=====================================
include/spdlog/fmt/bin_to_hex.h
=====================================
@@ -92,7 +92,7 @@ struct formatter<spdlog::details::dump_info<T>>
     auto parse(ParseContext &ctx) -> decltype(ctx.begin())
     {
         auto it = ctx.begin();
-        while (*it && *it != '}')
+        while (it != ctx.end() && *it != '}')
         {
             switch (*it)
             {


=====================================
include/spdlog/logger.h
=====================================
@@ -73,63 +73,58 @@ public:
 
     void swap(spdlog::logger &other) SPDLOG_NOEXCEPT;
 
+    // FormatString is a type derived from fmt::compile_string
+    template<typename FormatString, typename std::enable_if<fmt::is_compile_string<FormatString>::value, int>::type = 0, typename... Args>
+    void log(source_loc loc, level::level_enum lvl, const FormatString &fmt, const Args &... args)
+    {
+        log_(loc, lvl, fmt, args...);
+    }
+
+    // FormatString is NOT a type derived from fmt::compile_string but is a string_view_t or can be implicitly converted to one
     template<typename... Args>
     void log(source_loc loc, level::level_enum lvl, string_view_t fmt, const Args &... args)
     {
-        bool log_enabled = should_log(lvl);
-        bool traceback_enabled = tracer_.enabled();
-        if (!log_enabled && !traceback_enabled)
-        {
-            return;
-        }
-        SPDLOG_TRY
-        {
-            memory_buf_t buf;
-            fmt::format_to(buf, fmt, args...);
-            details::log_msg log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size()));
-            log_it_(log_msg, log_enabled, traceback_enabled);
-        }
-        SPDLOG_LOGGER_CATCH()
+        log_(loc, lvl, fmt, args...);
     }
 
-    template<typename... Args>
-    void log(level::level_enum lvl, string_view_t fmt, const Args &... args)
+    template<typename FormatString, typename... Args>
+    void log(level::level_enum lvl, const FormatString &fmt, const Args &... args)
     {
         log(source_loc{}, lvl, fmt, args...);
     }
 
-    template<typename... Args>
-    void trace(string_view_t fmt, const Args &... args)
+    template<typename FormatString, typename... Args>
+    void trace(const FormatString &fmt, const Args &... args)
     {
         log(level::trace, fmt, args...);
     }
 
-    template<typename... Args>
-    void debug(string_view_t fmt, const Args &... args)
+    template<typename FormatString, typename... Args>
+    void debug(const FormatString &fmt, const Args &... args)
     {
         log(level::debug, fmt, args...);
     }
 
-    template<typename... Args>
-    void info(string_view_t fmt, const Args &... args)
+    template<typename FormatString, typename... Args>
+    void info(const FormatString &fmt, const Args &... args)
     {
         log(level::info, fmt, args...);
     }
 
-    template<typename... Args>
-    void warn(string_view_t fmt, const Args &... args)
+    template<typename FormatString, typename... Args>
+    void warn(const FormatString &fmt, const Args &... args)
     {
         log(level::warn, fmt, args...);
     }
 
-    template<typename... Args>
-    void error(string_view_t fmt, const Args &... args)
+    template<typename FormatString, typename... Args>
+    void error(const FormatString &fmt, const Args &... args)
     {
         log(level::err, fmt, args...);
     }
 
-    template<typename... Args>
-    void critical(string_view_t fmt, const Args &... args)
+    template<typename FormatString, typename... Args>
+    void critical(const FormatString &fmt, const Args &... args)
     {
         log(level::critical, fmt, args...);
     }
@@ -140,8 +135,9 @@ public:
         log(source_loc{}, lvl, msg);
     }
 
-    // T can be statically converted to string_view
-    template<class T, typename std::enable_if<std::is_convertible<const T &, spdlog::string_view_t>::value, T>::type * = nullptr>
+    // T can be statically converted to string_view and isn't a fmt::compile_string
+    template<class T, typename std::enable_if<
+                          std::is_convertible<const T &, spdlog::string_view_t>::value && !fmt::is_compile_string<T>::value, int>::type = 0>
     void log(source_loc loc, level::level_enum lvl, const T &msg)
     {
         log(loc, lvl, string_view_t{msg});
@@ -181,7 +177,7 @@ public:
     // T cannot be statically converted to string_view or wstring_view
     template<class T, typename std::enable_if<!std::is_convertible<const T &, spdlog::string_view_t>::value &&
                                                   !is_convertible_to_wstring_view<const T &>::value,
-                          T>::type * = nullptr>
+                          int>::type = 0>
     void log(source_loc loc, level::level_enum lvl, const T &msg)
     {
         log(loc, lvl, "{}", msg);
@@ -251,50 +247,8 @@ public:
         SPDLOG_LOGGER_CATCH()
     }
 
-    template<typename... Args>
-    void log(level::level_enum lvl, wstring_view_t fmt, const Args &... args)
-    {
-        log(source_loc{}, lvl, fmt, args...);
-    }
-
-    template<typename... Args>
-    void trace(wstring_view_t fmt, const Args &... args)
-    {
-        log(level::trace, fmt, args...);
-    }
-
-    template<typename... Args>
-    void debug(wstring_view_t fmt, const Args &... args)
-    {
-        log(level::debug, fmt, args...);
-    }
-
-    template<typename... Args>
-    void info(wstring_view_t fmt, const Args &... args)
-    {
-        log(level::info, fmt, args...);
-    }
-
-    template<typename... Args>
-    void warn(wstring_view_t fmt, const Args &... args)
-    {
-        log(level::warn, fmt, args...);
-    }
-
-    template<typename... Args>
-    void error(wstring_view_t fmt, const Args &... args)
-    {
-        log(level::err, fmt, args...);
-    }
-
-    template<typename... Args>
-    void critical(wstring_view_t fmt, const Args &... args)
-    {
-        log(level::critical, fmt, args...);
-    }
-
     // T can be statically converted to wstring_view
-    template<class T, typename std::enable_if<is_convertible_to_wstring_view<const T &>::value, T>::type * = nullptr>
+    template<class T, typename std::enable_if<is_convertible_to_wstring_view<const T &>::value, int>::type = 0>
     void log(source_loc loc, level::level_enum lvl, const T &msg)
     {
         bool log_enabled = should_log(lvl);
@@ -370,6 +324,26 @@ protected:
     err_handler custom_err_handler_{nullptr};
     details::backtracer tracer_;
 
+    // common implementation for after templated public api has been resolved
+    template<typename FormatString, typename... Args>
+    void log_(source_loc loc, level::level_enum lvl, const FormatString &fmt, const Args &... args)
+    {
+        bool log_enabled = should_log(lvl);
+        bool traceback_enabled = tracer_.enabled();
+        if (!log_enabled && !traceback_enabled)
+        {
+            return;
+        }
+        SPDLOG_TRY
+        {
+            memory_buf_t buf;
+            fmt::format_to(buf, fmt, args...);
+            details::log_msg log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size()));
+            log_it_(log_msg, log_enabled, traceback_enabled);
+        }
+        SPDLOG_LOGGER_CATCH()
+    }
+
     // log the given message (if the given log level is high enough),
     // and save backtrace (if backtrace is enabled).
     void log_it_(const details::log_msg &log_msg, bool log_enabled, bool traceback_enabled);


=====================================
include/spdlog/spdlog.h
=====================================
@@ -121,50 +121,50 @@ SPDLOG_API spdlog::logger *default_logger_raw();
 
 SPDLOG_API void set_default_logger(std::shared_ptr<spdlog::logger> default_logger);
 
-template<typename... Args>
-inline void log(source_loc source, level::level_enum lvl, string_view_t fmt, const Args &... args)
+template<typename FormatString, typename... Args>
+inline void log(source_loc source, level::level_enum lvl, const FormatString &fmt, const Args &... args)
 {
     default_logger_raw()->log(source, lvl, fmt, args...);
 }
 
-template<typename... Args>
-inline void log(level::level_enum lvl, string_view_t fmt, const Args &... args)
+template<typename FormatString, typename... Args>
+inline void log(level::level_enum lvl, const FormatString &fmt, const Args &... args)
 {
     default_logger_raw()->log(source_loc{}, lvl, fmt, args...);
 }
 
-template<typename... Args>
-inline void trace(string_view_t fmt, const Args &... args)
+template<typename FormatString, typename... Args>
+inline void trace(const FormatString &fmt, const Args &... args)
 {
     default_logger_raw()->trace(fmt, args...);
 }
 
-template<typename... Args>
-inline void debug(string_view_t fmt, const Args &... args)
+template<typename FormatString, typename... Args>
+inline void debug(const FormatString &fmt, const Args &... args)
 {
     default_logger_raw()->debug(fmt, args...);
 }
 
-template<typename... Args>
-inline void info(string_view_t fmt, const Args &... args)
+template<typename FormatString, typename... Args>
+inline void info(const FormatString &fmt, const Args &... args)
 {
     default_logger_raw()->info(fmt, args...);
 }
 
-template<typename... Args>
-inline void warn(string_view_t fmt, const Args &... args)
+template<typename FormatString, typename... Args>
+inline void warn(const FormatString &fmt, const Args &... args)
 {
     default_logger_raw()->warn(fmt, args...);
 }
 
-template<typename... Args>
-inline void error(string_view_t fmt, const Args &... args)
+template<typename FormatString, typename... Args>
+inline void error(const FormatString &fmt, const Args &... args)
 {
     default_logger_raw()->error(fmt, args...);
 }
 
-template<typename... Args>
-inline void critical(string_view_t fmt, const Args &... args)
+template<typename FormatString, typename... Args>
+inline void critical(const FormatString &fmt, const Args &... args)
 {
     default_logger_raw()->critical(fmt, args...);
 }
@@ -217,57 +217,6 @@ inline void critical(const T &msg)
     default_logger_raw()->critical(msg);
 }
 
-#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
-template<typename... Args>
-inline void log(source_loc source, level::level_enum lvl, wstring_view_t fmt, const Args &... args)
-{
-    default_logger_raw()->log(source, lvl, fmt, args...);
-}
-
-template<typename... Args>
-inline void log(level::level_enum lvl, wstring_view_t fmt, const Args &... args)
-{
-    default_logger_raw()->log(lvl, fmt, args...);
-}
-
-template<typename... Args>
-inline void trace(wstring_view_t fmt, const Args &... args)
-{
-    default_logger_raw()->trace(fmt, args...);
-}
-
-template<typename... Args>
-inline void debug(wstring_view_t fmt, const Args &... args)
-{
-    default_logger_raw()->debug(fmt, args...);
-}
-
-template<typename... Args>
-inline void info(wstring_view_t fmt, const Args &... args)
-{
-    default_logger_raw()->info(fmt, args...);
-}
-
-template<typename... Args>
-inline void warn(wstring_view_t fmt, const Args &... args)
-{
-    default_logger_raw()->warn(fmt, args...);
-}
-
-template<typename... Args>
-inline void error(wstring_view_t fmt, const Args &... args)
-{
-    default_logger_raw()->error(fmt, args...);
-}
-
-template<typename... Args>
-inline void critical(wstring_view_t fmt, const Args &... args)
-{
-    default_logger_raw()->critical(fmt, args...);
-}
-
-#endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT
-
 } // namespace spdlog
 
 //


=====================================
include/spdlog/version.h
=====================================
@@ -4,7 +4,7 @@
 #pragma once
 
 #define SPDLOG_VER_MAJOR 1
-#define SPDLOG_VER_MINOR 6
-#define SPDLOG_VER_PATCH 1
+#define SPDLOG_VER_MINOR 7
+#define SPDLOG_VER_PATCH 0
 
 #define SPDLOG_VERSION (SPDLOG_VER_MAJOR * 10000 + SPDLOG_VER_MINOR * 100 + SPDLOG_VER_PATCH)


=====================================
tests/CMakeLists.txt
=====================================
@@ -2,46 +2,46 @@ cmake_minimum_required(VERSION 3.2)
 
 project(spdlog_utests CXX)
 
-if(NOT TARGET spdlog)
+if (NOT TARGET spdlog)
     # Stand-alone build
     find_package(spdlog REQUIRED)
-endif()
+endif ()
 
 include(../cmake/utils.cmake)
 
 find_package(PkgConfig)
-if(PkgConfig_FOUND)
+if (PkgConfig_FOUND)
     pkg_check_modules(systemd libsystemd)
-endif()
+endif ()
 
 set(SPDLOG_UTESTS_SOURCES
-    test_file_helper.cpp
-    test_file_logging.cpp
-    test_daily_logger.cpp
-    test_misc.cpp
-    test_eventlog.cpp
-    test_pattern_formatter.cpp
-    test_async.cpp
-    test_registry.cpp
-    test_macros.cpp
-    utils.cpp
-    main.cpp
-    test_mpmc_q.cpp
-    test_dup_filter.cpp
-    test_fmt_helper.cpp
-    test_stdout_api.cpp
-    test_backtrace.cpp
-    test_create_dir.cpp
-    test_cfg.cpp
-    test_time_point.cpp)
+        test_file_helper.cpp
+        test_file_logging.cpp
+        test_daily_logger.cpp
+        test_misc.cpp
+        test_eventlog.cpp
+        test_pattern_formatter.cpp
+        test_async.cpp
+        test_registry.cpp
+        test_macros.cpp
+        utils.cpp
+        main.cpp
+        test_mpmc_q.cpp
+        test_dup_filter.cpp
+        test_fmt_helper.cpp
+        test_stdout_api.cpp
+        test_backtrace.cpp
+        test_create_dir.cpp
+        test_cfg.cpp
+        test_time_point.cpp)
 
-if(NOT SPDLOG_NO_EXCEPTIONS)
+if (NOT SPDLOG_NO_EXCEPTIONS)
     list(APPEND SPDLOG_UTESTS_SOURCES test_errors.cpp)
-endif()
+endif ()
 
-if(systemd_FOUND)
+if (systemd_FOUND)
     list(APPEND SPDLOG_UTESTS_SOURCES test_systemd.cpp)
-endif()
+endif ()
 
 enable_testing()
 
@@ -49,22 +49,22 @@ function(spdlog_prepare_test test_target spdlog_lib)
     add_executable(${test_target} ${SPDLOG_UTESTS_SOURCES})
     spdlog_enable_warnings(${test_target})
     target_link_libraries(${test_target} PRIVATE ${spdlog_lib})
-    if(systemd_FOUND)
+    if (systemd_FOUND)
         target_link_libraries(${test_target} PRIVATE ${systemd_LIBRARIES})
-    endif()
-    if(SPDLOG_SANITIZE_ADDRESS)
+    endif ()
+    if (SPDLOG_SANITIZE_ADDRESS)
         spdlog_enable_sanitizer(${test_target})
-    endif()
+    endif ()
     add_test(NAME ${test_target} COMMAND ${test_target})
     set_tests_properties(${test_target} PROPERTIES RUN_SERIAL ON)
 endfunction()
 
 # The compiled library tests
-if(SPDLOG_BUILD_TESTS OR SPDLOG_BUILD_ALL)
+if (SPDLOG_BUILD_TESTS OR SPDLOG_BUILD_ALL)
     spdlog_prepare_test(spdlog-utests spdlog::spdlog)
-endif()
+endif ()
 
 # The header-only library version tests
-if(SPDLOG_BUILD_TESTS_HO OR SPDLOG_BUILD_ALL)
+if (SPDLOG_BUILD_TESTS_HO OR SPDLOG_BUILD_ALL)
     spdlog_prepare_test(spdlog-utests-ho spdlog::spdlog_header_only)
-endif()
+endif ()


=====================================
tests/test_mpmc_q.cpp
=====================================
@@ -10,7 +10,7 @@ static milliseconds millis_from(const test_clock::time_point &tp0)
 TEST_CASE("dequeue-empty-nowait", "[mpmc_blocking_q]")
 {
     size_t q_size = 100;
-    milliseconds tolerance_wait(10);
+    milliseconds tolerance_wait(20);
     spdlog::details::mpmc_blocking_queue<int> q(q_size);
     int popped_item = 0;
 



View it on GitLab: https://salsa.debian.org/med-team/spdlog/-/commit/8c629bea5077c287eb3472a0729bdf53a9157226

-- 
View it on GitLab: https://salsa.debian.org/med-team/spdlog/-/commit/8c629bea5077c287eb3472a0729bdf53a9157226
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200716/d003065e/attachment-0001.html>


More information about the debian-med-commit mailing list