GCC Code Coverage Report | |||||||||||||||||||||
|
|||||||||||||||||||||
Line | Branch | Exec | Source |
1 |
// |
||
2 |
// Created by 4c3y (acey) on 16.09.22. |
||
3 |
// |
||
4 |
|||
5 |
#include <gtest/gtest.h> |
||
6 |
#include <log++.h> |
||
7 |
#include <mutex> |
||
8 |
#include <async_tests.h> |
||
9 |
|||
10 |
1 |
std::vector<AsyncTest> generateTests() { |
|
11 |
return { |
||
12 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_lpp_syntax_severity_debug_Test","Test123",[]() { LOG_TIMED(D, 1, "Test" << 123); }, IS_SUBSTRING, STDERR}, |
13 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_lpp_syntax_severity_info_Test","Test123",[]() { LOG_TIMED(I, 1, "Test" << 123); }, IS_SUBSTRING, STDERR}, |
14 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_lpp_syntax_severity_warning_Test","Test123",[]() { LOG_TIMED(W, 1, "Test" << 123); }, IS_SUBSTRING, STDERR}, |
15 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_lpp_syntax_severity_error_Test","Test123",[]() { LOG_TIMED(E, 1, "Test" << 123); }, IS_SUBSTRING, STDERR}, |
16 |
//{"glog_timed_lpp_syntax_severity_fatal_Test","Test123",[]() { LOG_TIMED(F, 1, "Test" << 123); }, IS_SUBSTRING, STDERR}, |
||
17 |
|||
18 |
✓✗✓✓ ✗✓✗✓ ✗✓✗✓ ✗ |
76 |
{"glog_timed_glog_syntax_severity_debug_Test","Test123",[]() { DLOG_EVERY_T(INFO, 1) << "Test" << 123; }, IS_SUBSTRING, STDERR}, |
19 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_glog_syntax_severity_info_Test","Test123",[]() { LOG_EVERY_T(INFO, 1) << "Test" << 123; }, IS_SUBSTRING, STDERR}, |
20 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_glog_syntax_severity_warning_Test","Test123",[]() { LOG_EVERY_T(WARNING, 1) << "Test" << 123; }, IS_SUBSTRING, STDERR}, |
21 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_glog_syntax_severity_error_Test","Test123",[]() { LOG_EVERY_T(ERROR, 1) << "Test" << 123; }, IS_SUBSTRING, STDERR}, |
22 |
//{"glog_timed_glog_syntax_severity_fatal_Test","Test123",[]() { LOG_EVERY_T(FATAL, 1) << "Test" << 123; }, IS_SUBSTRING, STDERR}, |
||
23 |
|||
24 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_ros_syntax_severity_debug_Test", "Test123", []() {ROS_DEBUG_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
25 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_ros_syntax_severity_debug_stream_Test", "Test123", []() {ROS_DEBUG_STREAM_THROTTLE(1, "Test" << 123); }, IS_SUBSTRING, STDERR}, |
26 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_ros_syntax_severity_info_Test", "Test123", []() {ROS_INFO_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
27 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_ros_syntax_severity_info_stream_Test", "Test123", []() {ROS_INFO_STREAM_THROTTLE(1, "Test" << 123); }, IS_SUBSTRING, STDERR}, |
28 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_ros_syntax_severity_warning_Test", "Test123", []() {ROS_WARN_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
29 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_ros_syntax_severity_warning_stream_Test", "Test123", []() {ROS_WARN_STREAM_THROTTLE(1, "Test" << 123); }, IS_SUBSTRING, STDERR}, |
30 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_ros_syntax_severity_error_Test", "Test123", []() {ROS_ERROR_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
31 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"glog_timed_ros_syntax_severity_error_stream_Test", "Test123", []() {ROS_ERROR_STREAM_THROTTLE(1, "Test" << 123); }, IS_SUBSTRING, STDERR}, |
32 |
//{"glog_timed_ros_syntax_severity_fatal_Test", "Test123", []() {ROS_FATAL_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
||
33 |
//{"glog_timed_ros_syntax_severity_fatal_stream_Test", "Test123", []() {ROS_FATAL_STREAM_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
||
34 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✓ ✗✗ |
17 |
}; |
35 |
} |
||
36 |
|||
37 |
4 |
TEST(glog_timed, lpp_syntax_floating_point_time) { |
|
38 |
✓✗ | 2 |
LOG_INIT(*test_argv); |
39 |
✓✓ | 12 |
for (int i = 0; i < 5; i++) { |
40 |
|||
41 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
15 |
std::string output = LPP_CAPTURE_STDERR(LOG_TIMED(I, 0.1, "Test" << 123)); |
42 |
✓✓ | 10 |
if (i % 2 == 0) { |
43 |
✓✗✓✗ ✗✓✗✗ ✗✗✗✗ ✗✗ |
6 |
ASSERT_TRUE(isSubstring(output, "I")); |
44 |
✓✗✓✗ ✗✓✗✗ ✗✗✗✗ ✗✗ |
6 |
ASSERT_TRUE(isSubstring(output, "Test123")); |
45 |
} |
||
46 |
//sleep 0.1s |
||
47 |
✓✗ | 10 |
std::this_thread::sleep_for(std::chrono::milliseconds(50)); |
48 |
} |
||
49 |
} |
||
50 |
|||
51 |
4 |
TEST(glog_timed, lpp_syntax_severity_debug) { |
|
52 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
53 |
} |
||
54 |
|||
55 |
4 |
TEST(glog_timed, lpp_syntax_severity_info) { |
|
56 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
57 |
} |
||
58 |
|||
59 |
4 |
TEST(glog_timed, lpp_syntax_severity_warning) { |
|
60 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
61 |
} |
||
62 |
|||
63 |
4 |
TEST(glog_timed, lpp_syntax_severity_error) { |
|
64 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
65 |
} |
||
66 |
|||
67 |
4 |
TEST(glog_timed, lpp_syntax_severity_fatal) { |
|
68 |
//ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
||
69 |
2 |
} |
|
70 |
|||
71 |
4 |
TEST(glog_timed, glog_syntax_severity_debug) { |
|
72 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
73 |
} |
||
74 |
|||
75 |
4 |
TEST(glog_timed, glog_syntax_severity_info) { |
|
76 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
77 |
} |
||
78 |
|||
79 |
4 |
TEST(glog_timed, glog_syntax_severity_warning) { |
|
80 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
81 |
} |
||
82 |
|||
83 |
4 |
TEST(glog_timed, glog_syntax_severity_error) { |
|
84 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
85 |
} |
||
86 |
|||
87 |
4 |
TEST(glog_timed, glog_syntax_severity_fatal) { |
|
88 |
//ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
||
89 |
2 |
} |
|
90 |
|||
91 |
4 |
TEST(glog_timed, ros_syntax_severity_debug) { |
|
92 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
93 |
} |
||
94 |
|||
95 |
4 |
TEST(glog_timed, ros_syntax_severity_debug_stream) { |
|
96 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
97 |
} |
||
98 |
|||
99 |
4 |
TEST(glog_timed, ros_syntax_severity_info) { |
|
100 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
101 |
} |
||
102 |
|||
103 |
4 |
TEST(glog_timed, ros_syntax_severity_info_stream) { |
|
104 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
105 |
} |
||
106 |
|||
107 |
4 |
TEST(glog_timed, ros_syntax_severity_warning) { |
|
108 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
109 |
} |
||
110 |
|||
111 |
4 |
TEST(glog_timed, ros_syntax_severity_warning_stream) { |
|
112 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
113 |
} |
||
114 |
|||
115 |
4 |
TEST(glog_timed, ros_syntax_severity_error) { |
|
116 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
117 |
} |
||
118 |
|||
119 |
4 |
TEST(glog_timed, ros_syntax_severity_error_stream) { |
|
120 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
121 |
} |
||
122 |
|||
123 |
4 |
TEST(glog_timed, ros_syntax_severity_fatal) { |
|
124 |
//ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
||
125 |
2 |
} |
|
126 |
|||
127 |
4 |
TEST(glog_timed, ros_syntax_severity_fatal_stream) { |
|
128 |
//ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
||
129 |
2 |
} |
Generated by: GCOVR (Version 4.2) |