test: Add a helper to check the next line against a regex

Add a new ut_assert_nextline_regex() macro and ut_check_console_line_regex()
helper to check console output against a regex pattern. This is useful when
the exact output varies (e.g., file paths or line numbers in error messages).

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
Simon Glass
2025-12-14 08:46:23 -07:00
parent 6e5c5a0993
commit 1fbf894923
3 changed files with 53 additions and 0 deletions

View File

@@ -451,6 +451,9 @@ ut_assert_nextlinen(fmt, args...)
Assert that the next console output line matches up to the format
string length
ut_assert_nextline_regex(pattern)
Assert that the next console output line matches a regex pattern
ut_assert_nextline_empty()
Assert that the next console output line is empty