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 |
{"default_timed_lpp_syntax_severity_debug_Test","DEBUG Test123\n",[]() { LOG_TIMED(D, 1, "Test" << 123); }, EQUAL, STDOUT}, |
13 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
30 |
{"default_timed_lpp_syntax_severity_info_Test","INFO Test123\n",[]() { LOG_TIMED(I, 1, "Test" << 123); }, EQUAL, STDOUT}, |
14 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
30 |
{"default_timed_lpp_syntax_severity_warning_Test","WARN Test123\n",[]() { LOG_TIMED(W, 1, "Test" << 123); }, EQUAL, STDOUT}, |
15 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
30 |
{"default_timed_lpp_syntax_severity_error_Test","ERROR Test123\n",[]() { LOG_TIMED(E, 1, "Test" << 123); }, EQUAL, STDOUT}, |
16 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
30 |
{"default_timed_lpp_syntax_severity_fatal_Test","FATAL Test123\n",[]() { LOG_TIMED(F, 1, "Test" << 123); }, EQUAL, STDOUT}, |
17 |
|||
18 |
✓✗✓✓ ✗✓✗✓ ✗✓✗✓ ✗ |
76 |
{"default_timed_glog_syntax_severity_debug_Test","Test123",[]() { DLOG_EVERY_T(INFO, 1) << "Test" << 123; }, IS_SUBSTRING, STDERR}, |
19 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"default_timed_glog_syntax_severity_info_Test","Test123",[]() { LOG_EVERY_T(INFO, 1) << "Test" << 123; }, IS_SUBSTRING, STDOUT}, |
20 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"default_timed_glog_syntax_severity_warning_Test","Test123",[]() { LOG_EVERY_T(WARNING, 1) << "Test" << 123; }, IS_SUBSTRING, STDOUT}, |
21 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"default_timed_glog_syntax_severity_error_Test","Test123",[]() { LOG_EVERY_T(ERROR, 1) << "Test" << 123; }, IS_SUBSTRING, STDOUT}, |
22 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
30 |
{"default_timed_glog_syntax_severity_fatal_Test","Test123",[]() { LOG_EVERY_T(FATAL, 1) << "Test" << 123; }, IS_SUBSTRING, STDOUT}, |
23 |
|||
24 |
✗✓✓✓ ✓✗✓✗ ✗✓✓✗ ✓✓✗✓ |
30 |
{"default_timed_ros_syntax_severity_debug_Test", "Test123", []() {ROS_DEBUG_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDOUT}, |
25 |
✗✓✓✓ ✓✗✓✗ ✗✓✓✗ ✓✓✗✓ ✓✗✓✗ ✓✗ |
38 |
{"default_timed_ros_syntax_severity_debug_stream_Test", "Test123", []() {ROS_DEBUG_STREAM_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDOUT}, |
26 |
✗✓✓✓ ✓✗✓✗ ✗✓✓✗ ✓✓✗✓ |
30 |
{"default_timed_ros_syntax_severity_info_Test", "Test123", []() {ROS_INFO_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDOUT}, |
27 |
✗✓✓✓ ✓✗✓✗ ✗✓✓✗ ✓✓✗✓ ✓✗✓✗ ✓✗ |
38 |
{"default_timed_ros_syntax_severity_info_stream_Test", "Test123", []() {ROS_INFO_STREAM_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDOUT}, |
28 |
✗✓✓✓ ✓✗✓✗ ✗✓✓✗ ✓✓✗✓ |
30 |
{"default_timed_ros_syntax_severity_warning_Test", "Test123", []() {ROS_WARN_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
29 |
✗✓✓✓ ✓✗✓✗ ✗✓✓✗ ✓✓✗✓ ✓✗✓✗ ✓✗ |
38 |
{"default_timed_ros_syntax_severity_warning_stream_Test", "Test123", []() {ROS_WARN_STREAM_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
30 |
✗✓✓✓ ✓✗✓✗ ✗✓✓✗ ✓✓✗✓ |
30 |
{"default_timed_ros_syntax_severity_error_Test", "Test123", []() {ROS_ERROR_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
31 |
✗✓✓✓ ✓✗✓✗ ✗✓✓✗ ✓✓✗✓ ✓✗✓✗ ✓✗ |
38 |
{"default_timed_ros_syntax_severity_error_stream_Test", "Test123", []() {ROS_ERROR_STREAM_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
32 |
✗✓✓✓ ✓✗✓✗ ✗✓✓✗ ✓✓✗✓ |
30 |
{"default_timed_ros_syntax_severity_fatal_Test", "Test123", []() {ROS_FATAL_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
33 |
✗✓✓✓ ✓✗✓✗ ✗✓✓✗ ✓✓✗✓ ✓✗✓✗ ✓✗ |
38 |
{"default_timed_ros_syntax_severity_fatal_stream_Test", "Test123", []() {ROS_FATAL_STREAM_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR}, |
34 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✓ ✗✗ |
21 |
}; |
35 |
} |
||
36 |
|||
37 |
4 |
TEST(default_timed, lpp_syntax_floating_point_time) { |
|
38 |
✓✓ | 12 |
for (int i = 0; i < 5; i++) { |
39 |
|||
40 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗ |
15 |
std::string output = LPP_CAPTURE_STDOUT(LOG_TIMED(I, 0.1, "Test" << 123)); |
41 |
✓✓ | 10 |
if (i % 2 == 0) { |
42 |
✓✗✓✗ ✗✓✗✗ ✗✗✗✗ ✗✗ |
6 |
ASSERT_TRUE(isSubstring(output, "I")); |
43 |
✓✗✓✗ ✗✓✗✗ ✗✗✗✗ ✗✗ |
6 |
ASSERT_TRUE(isSubstring(output, "Test123")); |
44 |
} |
||
45 |
//sleep 0.1s |
||
46 |
✓✗ | 10 |
std::this_thread::sleep_for(std::chrono::milliseconds(50)); |
47 |
} |
||
48 |
} |
||
49 |
|||
50 |
4 |
TEST(default_timed, lpp_syntax_severity_debug) { |
|
51 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
52 |
} |
||
53 |
|||
54 |
4 |
TEST(default_timed, lpp_syntax_severity_info) { |
|
55 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
56 |
} |
||
57 |
|||
58 |
4 |
TEST(default_timed, lpp_syntax_severity_warning) { |
|
59 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
60 |
} |
||
61 |
|||
62 |
4 |
TEST(default_timed, lpp_syntax_severity_error) { |
|
63 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
64 |
} |
||
65 |
|||
66 |
4 |
TEST(default_timed, lpp_syntax_severity_fatal) { |
|
67 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
68 |
} |
||
69 |
|||
70 |
4 |
TEST(default_timed, glog_syntax_severity_debug) { |
|
71 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
72 |
} |
||
73 |
|||
74 |
4 |
TEST(default_timed, glog_syntax_severity_info) { |
|
75 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
76 |
} |
||
77 |
|||
78 |
4 |
TEST(default_timed, glog_syntax_severity_warning) { |
|
79 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
80 |
} |
||
81 |
|||
82 |
4 |
TEST(default_timed, glog_syntax_severity_error) { |
|
83 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
84 |
} |
||
85 |
|||
86 |
4 |
TEST(default_timed, glog_syntax_severity_fatal) { |
|
87 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
88 |
} |
||
89 |
|||
90 |
4 |
TEST(default_timed, ros_syntax_severity_debug) { |
|
91 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
92 |
} |
||
93 |
|||
94 |
4 |
TEST(default_timed, ros_syntax_severity_debug_stream) { |
|
95 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
96 |
} |
||
97 |
|||
98 |
4 |
TEST(default_timed, ros_syntax_severity_info) { |
|
99 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
100 |
} |
||
101 |
|||
102 |
4 |
TEST(default_timed, ros_syntax_severity_info_stream) { |
|
103 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
104 |
} |
||
105 |
|||
106 |
4 |
TEST(default_timed, ros_syntax_severity_warning) { |
|
107 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
108 |
} |
||
109 |
|||
110 |
4 |
TEST(default_timed, ros_syntax_severity_warning_stream) { |
|
111 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
112 |
} |
||
113 |
|||
114 |
4 |
TEST(default_timed, ros_syntax_severity_error) { |
|
115 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
116 |
} |
||
117 |
|||
118 |
4 |
TEST(default_timed, ros_syntax_severity_error_stream) { |
|
119 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
120 |
} |
||
121 |
|||
122 |
4 |
TEST(default_timed, ros_syntax_severity_fatal) { |
|
123 |
✓✗✓✗ ✓✗✗✓ ✗✗✗✗ ✗✗✗✗ |
2 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
124 |
} |
||
125 |
|||
126 |
2 |
TEST(default_timed, ros_syntax_severity_fatal_stream) { |
|
127 |
1 |
ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr))); |
|
128 |
} |
Generated by: GCOVR (Version 4.2) |