Skip to content

Add regex checks for logger timestamps and PIDs - #5

Open
lplewa wants to merge 1 commit into
mainfrom
codex/enhance-timestamp_log-and-pid_log-tests
Open

Add regex checks for logger timestamps and PIDs#5
lplewa wants to merge 1 commit into
mainfrom
codex/enhance-timestamp_log-and-pid_log-tests

Conversation

@lplewa

@lplewa lplewa commented Jun 10, 2025

Copy link
Copy Markdown
Owner

Summary

  • expand log tests to capture output strings
  • verify timestamp output matches YYYY-MM-DDTHH:MM:SS format
  • verify PID/TID header exists when enabled

Testing

  • cmake --build build -j$(nproc)
  • ctest -R test_logger --output-on-failure

https://chatgpt.com/codex/tasks/task_e_684823a83050832194419c71f85a46ed


This change is Reviewable

@lplewa
lplewa force-pushed the main branch 2 times, most recently from b11534f to cde4cb8 Compare June 25, 2025 13:52

@KFilipek KFilipek left a comment

Copy link
Copy Markdown

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

@KFilipek

Copy link
Copy Markdown

There are failing build jobs, please fix it before merge.

Comment thread test/utils/utils_log.cpp
Comment on lines +360 to +363

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));

Copy link
Copy Markdown

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?

Comment thread test/utils/utils_log.cpp

#include "base.hpp"
#include "test_helpers.h"
#include <regex>

Copy link
Copy Markdown

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

Comment thread test/utils/utils_log.cpp
template <typename... Args> void helper_test_log(Args... args) {
fput_count = 0;
fflush_count = 0;
last_message.clear();

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants