mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 17:19:34 +08:00
Added Catch v3 support (#2661)
* Added Catch v3 support. * Removed extra square brackets from some tests.
This commit is contained in:
@@ -22,7 +22,7 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
TEST_CASE("default_error_handler", "[errors]]")
|
||||
TEST_CASE("default_error_handler", "[errors]")
|
||||
{
|
||||
prepare_logdir();
|
||||
spdlog::filename_t filename = SPDLOG_FILENAME_T(SIMPLE_LOG);
|
||||
@@ -40,7 +40,7 @@ TEST_CASE("default_error_handler", "[errors]]")
|
||||
|
||||
struct custom_ex
|
||||
{};
|
||||
TEST_CASE("custom_error_handler", "[errors]]")
|
||||
TEST_CASE("custom_error_handler", "[errors]")
|
||||
{
|
||||
prepare_logdir();
|
||||
spdlog::filename_t filename = SPDLOG_FILENAME_T(SIMPLE_LOG);
|
||||
@@ -54,7 +54,7 @@ TEST_CASE("custom_error_handler", "[errors]]")
|
||||
require_message_count(SIMPLE_LOG, 2);
|
||||
}
|
||||
|
||||
TEST_CASE("default_error_handler2", "[errors]]")
|
||||
TEST_CASE("default_error_handler2", "[errors]")
|
||||
{
|
||||
spdlog::drop_all();
|
||||
auto logger = spdlog::create<failing_sink>("failed_logger");
|
||||
@@ -62,7 +62,7 @@ TEST_CASE("default_error_handler2", "[errors]]")
|
||||
REQUIRE_THROWS_AS(logger->info("Some message"), custom_ex);
|
||||
}
|
||||
|
||||
TEST_CASE("flush_error_handler", "[errors]]")
|
||||
TEST_CASE("flush_error_handler", "[errors]")
|
||||
{
|
||||
spdlog::drop_all();
|
||||
auto logger = spdlog::create<failing_sink>("failed_logger");
|
||||
@@ -70,7 +70,7 @@ TEST_CASE("flush_error_handler", "[errors]]")
|
||||
REQUIRE_THROWS_AS(logger->flush(), custom_ex);
|
||||
}
|
||||
|
||||
TEST_CASE("async_error_handler", "[errors]]")
|
||||
TEST_CASE("async_error_handler", "[errors]")
|
||||
{
|
||||
prepare_logdir();
|
||||
std::string err_msg("log failed with some msg");
|
||||
@@ -98,7 +98,7 @@ TEST_CASE("async_error_handler", "[errors]]")
|
||||
}
|
||||
|
||||
// Make sure async error handler is executed
|
||||
TEST_CASE("async_error_handler2", "[errors]]")
|
||||
TEST_CASE("async_error_handler2", "[errors]")
|
||||
{
|
||||
prepare_logdir();
|
||||
std::string err_msg("This is async handler error message");
|
||||
|
Reference in New Issue
Block a user