-
Notifications
You must be signed in to change notification settings - Fork 0
Add regex checks for logger timestamps and PIDs #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
b11534f
to
cde4cb8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@KFilipek reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lplewa)
test/utils/utils_log.cpp
line 7 at r1 (raw file):
#include "base.hpp" #include "test_helpers.h" #include <regex>
Separate include block
There are failing build jobs, please fix it before merge. |
|
||
std::regex r("^\\[\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2} DEBUG UMF\\] " | ||
+ MOCK_FN_NAME + ": example log\\n$"); | ||
EXPECT_TRUE(std::regex_match(last_message, r)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you describe this regexp as a comment?
@@ -4,6 +4,7 @@ | |||
|
|||
#include "base.hpp" | |||
#include "test_helpers.h" | |||
#include <regex> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move it to the separate block
@@ -257,6 +260,7 @@ TEST_F(test, parseEnv) { | |||
template <typename... Args> void helper_test_log(Args... args) { | |||
fput_count = 0; | |||
fflush_count = 0; | |||
last_message.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add empty line after this call.
Summary
YYYY-MM-DDTHH:MM:SS
formatTesting
cmake --build build -j$(nproc)
ctest -R test_logger --output-on-failure
https://chatgpt.com/codex/tasks/task_e_684823a83050832194419c71f85a46ed
This change is