mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +08:00
Cleaned tests
This commit is contained in:
parent
b169859ce9
commit
8dc7ba7e3d
@ -49,4 +49,3 @@ using windebug_sink_st = msvc_sink_st;
|
||||
|
||||
} // namespace sinks
|
||||
} // namespace spdlog
|
||||
|
||||
|
@ -26,7 +26,7 @@ endif()
|
||||
set(SPDLOG_UTESTS_SOURCES
|
||||
test_file_helper.cpp
|
||||
test_file_logging.cpp
|
||||
test_daily_logger.cpp
|
||||
test_daily_and_rotation_loggers.cpp
|
||||
test_misc.cpp
|
||||
test_pattern_formatter.cpp
|
||||
test_async.cpp
|
||||
|
@ -28,11 +28,6 @@
|
||||
#include "spdlog/async.h"
|
||||
#include "spdlog/details/fmt_helper.h"
|
||||
#include "spdlog/pattern_formatter.h"
|
||||
#include "spdlog/sinks/basic_file_sink.h"
|
||||
#include "spdlog/sinks/daily_file_sink.h"
|
||||
#include "spdlog/sinks/msvc_sink.h"
|
||||
#include "spdlog/sinks/null_sink.h"
|
||||
#include "spdlog/sinks/ostream_sink.h"
|
||||
#include "spdlog/sinks/rotating_file_sink.h"
|
||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "includes.h"
|
||||
#include "spdlog/fmt/bin_to_hex.h"
|
||||
#include "spdlog/sinks/ostream_sink.h"
|
||||
#include "test_sink.h"
|
||||
|
||||
TEST_CASE("to_hex", "[to_hex]") {
|
||||
|
@ -3,6 +3,8 @@
|
||||
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
|
||||
*/
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/daily_file_sink.h"
|
||||
#include "spdlog/sinks/rotating_file_sink.h"
|
||||
|
||||
#ifdef SPDLOG_USE_STD_FORMAT
|
||||
using filename_memory_buf_t = std::basic_string<spdlog::filename_t::value_type>;
|
||||
@ -73,7 +75,6 @@ TEST_CASE("daily_logger with custom calculator", "[daily_logger]") {
|
||||
}
|
||||
|
||||
logger->flush();
|
||||
|
||||
require_message_count(filename_buf_to_utf8string(w), 10);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/basic_file_sink.h"
|
||||
|
||||
#define SIMPLE_LOG "test_logs/simple_log.txt"
|
||||
#define SIMPLE_ASYNC_LOG "test_logs/simple_async_log.txt"
|
||||
|
@ -3,6 +3,7 @@
|
||||
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
|
||||
*/
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/rotating_file_sink.h"
|
||||
|
||||
#define TEST_FILENAME "test_logs/file_helper_test.txt"
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
|
||||
*/
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/basic_file_sink.h"
|
||||
#include "spdlog/sinks/rotating_file_sink.h"
|
||||
|
||||
#define SIMPLE_LOG "test_logs/simple_log"
|
||||
#define ROTATING_LOG "test_logs/rotating_log"
|
||||
|
@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/basic_file_sink.h"
|
||||
|
||||
#if SPDLOG_ACTIVE_LEVEL != SPDLOG_LEVEL_DEBUG
|
||||
#error "Invalid SPDLOG_ACTIVE_LEVEL in test. Should be SPDLOG_LEVEL_DEBUG"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/ostream_sink.h"
|
||||
#include "test_sink.h"
|
||||
|
||||
template <class T>
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/ostream_sink.h"
|
||||
#include "test_sink.h"
|
||||
|
||||
using spdlog::memory_buf_t;
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/daily_file_sink.h"
|
||||
#include "spdlog/sinks/rotating_file_sink.h"
|
||||
|
||||
static const char *const tested_logger_name = "null_logger";
|
||||
static const char *const tested_logger_name2 = "null_logger2";
|
||||
|
@ -1,5 +1,6 @@
|
||||
#define SPDLOG_SOURCE_LOCATION
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/ostream_sink.h"
|
||||
#include "test_sink.h"
|
||||
|
||||
#if defined(SPDLOG_HAVE_STD_SOURCE_LOCATION) || defined(SPDLOG_HAVE_EXPERIMENTAL_SOURCE_LOCATION)
|
||||
@ -11,9 +12,10 @@ TEST_CASE("test_source_location", "[source_location]") {
|
||||
auto oss_sink = std::make_shared<spdlog::sinks::ostream_sink_st>(oss);
|
||||
spdlog::logger oss_logger("oss", oss_sink);
|
||||
oss_logger.set_pattern("%s:%# %v");
|
||||
|
||||
oss_logger.info("Hello {}", "source location");
|
||||
REQUIRE(oss.str() ==
|
||||
std::string("test_source_location.cpp:14 Hello source location") + default_eol);
|
||||
std::string("test_source_location.cpp:16 Hello source location") + default_eol);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user