#include <boost/filesystem.hpp>
#include "gtest/gtest.h"
#include "file_io_utils.h"
#include "misc_log_ex.h"
Go to the source code of this file.
|
| | TEST (logging, no_logs) |
| | TEST (logging, default) |
| | TEST (logging, all) |
| | TEST (logging, glob_suffix) |
| | TEST (logging, glob_prefix) |
| | TEST (logging, last_precedence) |
◆ TEST() [1/6]
Definition at line 123 of file logging.cpp.
124{
125 init();
127 log();
128 std::string str;
129 ASSERT_TRUE(load_log_to_string(log_filename, str));
130 ASSERT_TRUE(str.find(
"global") != std::string::npos);
131 ASSERT_TRUE(str.find(
"fatal") != std::string::npos);
132 ASSERT_TRUE(str.find(
"error") != std::string::npos);
133 ASSERT_TRUE(str.find(
"debug") != std::string::npos);
134 ASSERT_TRUE(str.find(
"trace") != std::string::npos);
135 cleanup();
136}
#define ASSERT_TRUE(condition)
void mlog_set_categories(const char *categories)
◆ TEST() [2/6]
| TEST |
( |
logging | , |
|
|
default | ) |
Definition at line 109 of file logging.cpp.
110{
111 init();
112 log();
113 std::string str;
114 ASSERT_TRUE(load_log_to_string(log_filename, str));
115 ASSERT_TRUE(str.find(
"global") != std::string::npos);
116 ASSERT_TRUE(str.find(
"fatal") != std::string::npos);
117 ASSERT_TRUE(str.find(
"error") != std::string::npos);
118 ASSERT_TRUE(str.find(
"debug") == std::string::npos);
119 ASSERT_TRUE(str.find(
"trace") == std::string::npos);
120 cleanup();
121}
◆ TEST() [3/6]
| TEST |
( |
logging | , |
|
|
glob_prefix | ) |
Definition at line 152 of file logging.cpp.
153{
154 init();
156 log();
157 std::string str;
158 ASSERT_TRUE(load_log_to_string(log_filename, str));
159 ASSERT_TRUE(str.find(
"global") == std::string::npos);
160 ASSERT_TRUE(str.find(
"x.y.z") != std::string::npos);
161 ASSERT_TRUE(str.find(
"x.y.x") == std::string::npos);
162 ASSERT_TRUE(str.find(
"y.y.z") != std::string::npos);
163 cleanup();
164}
◆ TEST() [4/6]
| TEST |
( |
logging | , |
|
|
glob_suffix | ) |
Definition at line 138 of file logging.cpp.
139{
140 init();
142 log();
143 std::string str;
144 ASSERT_TRUE(load_log_to_string(log_filename, str));
145 ASSERT_TRUE(str.find(
"global") == std::string::npos);
146 ASSERT_TRUE(str.find(
"x.y.z") != std::string::npos);
147 ASSERT_TRUE(str.find(
"x.y.x") != std::string::npos);
148 ASSERT_TRUE(str.find(
"y.y.z") == std::string::npos);
149 cleanup();
150}
◆ TEST() [5/6]
| TEST |
( |
logging | , |
|
|
last_precedence | ) |
Definition at line 166 of file logging.cpp.
167{
168 init();
170 log();
171 std::string str;
172 ASSERT_TRUE(load_log_to_string(log_filename, str));
174 ASSERT_TRUE(str.find(
"global") != std::string::npos);
175 ASSERT_TRUE(str.find(
"x.y.z") == std::string::npos);
176 ASSERT_TRUE(str.find(
"x.y.x") == std::string::npos);
177 ASSERT_TRUE(str.find(
"y.y.z") == std::string::npos);
178 cleanup();
179}
◆ TEST() [6/6]
| TEST |
( |
logging | , |
|
|
no_logs | ) |
Definition at line 98 of file logging.cpp.
99{
100 init();
102 log();
103 std::string str;
104 ASSERT_TRUE(load_log_to_string(log_filename, str));
106 cleanup();
107}