Commit 08de6425 authored by gabime's avatar gabime

Added stdout tests

parent ab9e1b3a
......@@ -13,7 +13,8 @@ set(SPDLOG_UTESTS_SOURCES
main.cpp
test_mpmc_q.cpp
test_sink.h
test_fmt_helper.cpp)
test_fmt_helper.cpp
test_stdout_api.cpp)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
enable_testing()
......
/*
* This content is released under the MIT License as specified in https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
*/
#include "includes.h"
#include "spdlog/sinks/stdout_sinks.h"
#include "spdlog/sinks/stdout_color_sinks.h"
TEST_CASE("stdout_st", "[stdout]")
{
auto l = spdlog::stdout_logger_st("test");
l->set_pattern("%+");
l->set_level(spdlog::level::trace);
l->trace("Test stdout_st");
spdlog::drop_all();
}
TEST_CASE("stdout_mt", "[stdout]")
{
auto l = spdlog::stdout_logger_mt("test");
l->set_pattern("%+");
l->set_level(spdlog::level::debug);
l->debug("Test stdout_mt");
spdlog::drop_all();
}
TEST_CASE("stderr_st", "[stderr]")
{
auto l = spdlog::stderr_logger_st("test");
l->set_pattern("%+");
l->info("Test stderr_st");
spdlog::drop_all();
}
TEST_CASE("stderr_mt", "[stderr]")
{
auto l = spdlog::stderr_logger_mt("test");
l->set_pattern("%+");
l->info("Test stderr_mt");
l->warn("Test stderr_mt");
l->error("Test stderr_mt");
l->critical("Test stderr_mt");
spdlog::drop_all();
}
// color loggers
TEST_CASE("stdout_color_st", "[stdout]")
{
auto l = spdlog::stdout_color_st("test");
l->set_pattern("%+");
l->info("Test stdout_color_st");
spdlog::drop_all();
}
TEST_CASE("stdout_color_mt", "[stdout]")
{
auto l = spdlog::stdout_color_mt("test");
l->set_pattern("%+");
l->set_level(spdlog::level::trace);
l->trace("Test stdout_color_mt");
spdlog::drop_all();
}
TEST_CASE("stderr_color_st", "[stderr]")
{
auto l = spdlog::stderr_color_st("test");
l->set_pattern("%+");
l->set_level(spdlog::level::debug);
l->debug("Test stderr_color_st");
spdlog::drop_all();
}
TEST_CASE("stderr_color_mt", "[stderr]")
{
auto l = spdlog::stderr_color_mt("test");
l->set_pattern("%+");
l->info("Test stderr_color_mt");
l->warn("Test stderr_color_mt");
l->error("Test stderr_color_mt");
l->critical("Test stderr_color_mt");
spdlog::drop_all();
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment