Skip to content

Commit

Permalink
gtest: Add support for gtest 1.15.0
Browse files Browse the repository at this point in the history
The gtest 1.15 has slightly different output from the original one that
was used to set up the harness. With this change we support both output
formats.

Fixes #72318

(cherry picked from commit bfb893a)

Original-Signed-off-by: Yuval Peress <peress@google.com>
GitOrigin-RevId: bfb893a
Cr-Build-Id: 8738819815572775377
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8738819815572775377
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: I39fdd2f3f10e567a0c19f8532d06d2ad6a6d4953
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5808856
Reviewed-by: Eric Yilun Lin <yllin@google.com>
Commit-Queue: Eric Yilun Lin <yllin@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Tested-by: Eric Yilun Lin <yllin@google.com>
  • Loading branch information
yperess authored and Chromeos LUCI committed Aug 23, 2024
1 parent 716cb51 commit aff41aa
Show file tree
Hide file tree
Showing 2 changed files with 479 additions and 205 deletions.
15 changes: 10 additions & 5 deletions scripts/pylib/twister/twisterlib/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,16 @@ def _parse_report_file(self, report):

class Gtest(Harness):
ANSI_ESCAPE = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
TEST_START_PATTERN = r".*\[ RUN \] (?P<suite_name>[a-zA-Z_][a-zA-Z0-9_]*)\.(?P<test_name>[a-zA-Z_][a-zA-Z0-9_]*)"
TEST_PASS_PATTERN = r".*\[ OK \] (?P<suite_name>[a-zA-Z_][a-zA-Z0-9_]*)\.(?P<test_name>[a-zA-Z_][a-zA-Z0-9_]*)"
TEST_SKIP_PATTERN = r".*\[ DISABLED \] (?P<suite_name>[a-zA-Z_][a-zA-Z0-9_]*)\.(?P<test_name>[a-zA-Z_][a-zA-Z0-9_]*)"
TEST_FAIL_PATTERN = r".*\[ FAILED \] (?P<suite_name>[a-zA-Z_][a-zA-Z0-9_]*)\.(?P<test_name>[a-zA-Z_][a-zA-Z0-9_]*)"
FINISHED_PATTERN = r".*\[==========\] Done running all tests\."
_NAME_PATTERN = "[a-zA-Z_][a-zA-Z0-9_]*"
_SUITE_TEST_NAME_PATTERN = f"(?P<suite_name>{_NAME_PATTERN})\\.(?P<test_name>{_NAME_PATTERN})"
TEST_START_PATTERN = f".*\\[ RUN \\] {_SUITE_TEST_NAME_PATTERN}"
TEST_PASS_PATTERN = f".*\\[ OK \\] {_SUITE_TEST_NAME_PATTERN}"
TEST_SKIP_PATTERN = f".*\\[ DISABLED \\] {_SUITE_TEST_NAME_PATTERN}"
TEST_FAIL_PATTERN = f".*\\[ FAILED \\] {_SUITE_TEST_NAME_PATTERN}"
FINISHED_PATTERN = (
".*(?:\\[==========\\] Done running all tests\\.|"
+ "\\[----------\\] Global test environment tear-down)"
)

def __init__(self):
super().__init__()
Expand Down
Loading

0 comments on commit aff41aa

Please sign in to comment.