mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 03:19:02 +08:00
Print error and abort instead of throw if SPDLOG_NO_EXEPTIONS is defined
This commit is contained in:
@@ -8,7 +8,6 @@ if(PkgConfig_FOUND)
|
||||
endif()
|
||||
|
||||
set(SPDLOG_UTESTS_SOURCES
|
||||
test_errors.cpp
|
||||
test_file_helper.cpp
|
||||
test_file_logging.cpp
|
||||
test_misc.cpp
|
||||
@@ -26,6 +25,10 @@ set(SPDLOG_UTESTS_SOURCES
|
||||
test_stdout_api.cpp
|
||||
test_dup_filter.cpp)
|
||||
|
||||
if(NOT SPDLOG_NO_EXCEPTIONS)
|
||||
list(APPEND SPDLOG_UTESTS_SOURCES test_errors.cpp)
|
||||
endif()
|
||||
|
||||
if(systemd_FOUND)
|
||||
list(APPEND SPDLOG_UTESTS_SOURCES test_systemd.cpp)
|
||||
endif()
|
||||
|
@@ -3,6 +3,7 @@
|
||||
static const char *tested_logger_name = "null_logger";
|
||||
static const char *tested_logger_name2 = "null_logger2";
|
||||
|
||||
#ifndef SPDLOG_NO_EXCEPTIONS
|
||||
TEST_CASE("register_drop", "[registry]")
|
||||
{
|
||||
spdlog::drop_all();
|
||||
@@ -21,6 +22,7 @@ TEST_CASE("explicit register", "[registry]")
|
||||
// Throw if registring existing name
|
||||
REQUIRE_THROWS_AS(spdlog::create<spdlog::sinks::null_sink_mt>(tested_logger_name), spdlog::spdlog_ex);
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_CASE("apply_all", "[registry]")
|
||||
{
|
||||
|
Reference in New Issue
Block a user