diff options
author | Copybara-Service <copybara-worker@google.com> | 2024-04-08 20:02:42 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-04-08 20:02:42 (GMT) |
commit | 3d73dee972d0db344bda9b659836612aba6a3564 (patch) | |
tree | 373b25443a5edf952a220c38f5a9c4c42872bf89 /googletest/test | |
parent | f10e11fb27301fba21caa71030bb5024e67aa135 (diff) | |
parent | f16770d63dcb69019c0547b26a4a433d2cc62bd7 (diff) | |
download | googletest-3d73dee972d0db344bda9b659836612aba6a3564.zip googletest-3d73dee972d0db344bda9b659836612aba6a3564.tar.gz googletest-3d73dee972d0db344bda9b659836612aba6a3564.tar.bz2 |
Merge pull request #4508 from davidmatson:addJsonSkipped
PiperOrigin-RevId: 622929007
Change-Id: Ifaf5a701baee74503e6845f32ebc27425882e950
Diffstat (limited to 'googletest/test')
-rw-r--r-- | googletest/test/googletest-json-output-unittest.py | 15 | ||||
-rw-r--r-- | googletest/test/gtest_json_test_utils.py | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/googletest/test/googletest-json-output-unittest.py b/googletest/test/googletest-json-output-unittest.py index cb97694..d3338e3 100644 --- a/googletest/test/googletest-json-output-unittest.py +++ b/googletest/test/googletest-json-output-unittest.py @@ -150,6 +150,9 @@ EXPECTED_NON_EMPTY = { 'time': '*', 'timestamp': '*', 'classname': 'SkippedTest', + 'skipped': [ + {'message': 'gtest_xml_output_unittest_.cc:*\n\n'} + ], }, { 'name': 'SkippedWithMessage', @@ -160,6 +163,12 @@ EXPECTED_NON_EMPTY = { 'time': '*', 'timestamp': '*', 'classname': 'SkippedTest', + 'skipped': [{ + 'message': ( + 'gtest_xml_output_unittest_.cc:*\n' + 'It is good practice to tell why you skip a test.\n' + ) + }], }, { 'name': 'SkippedAfterFailure', @@ -179,6 +188,12 @@ EXPECTED_NON_EMPTY = { ), 'type': '', }], + 'skipped': [{ + 'message': ( + 'gtest_xml_output_unittest_.cc:*\n' + 'It is good practice to tell why you skip a test.\n' + ) + }], }, ], }, diff --git a/googletest/test/gtest_json_test_utils.py b/googletest/test/gtest_json_test_utils.py index 86a5925..694a7a6 100644 --- a/googletest/test/gtest_json_test_utils.py +++ b/googletest/test/gtest_json_test_utils.py @@ -51,6 +51,9 @@ def normalize(obj): elif key == 'failure': value = re.sub(r'^.*[/\\](.*:)\d+\n', '\\1*\n', value) return re.sub(r'Stack trace:\n(.|\n)*', 'Stack trace:\n*', value) + elif key == 'message': + value = re.sub(r'^.*[/\\](.*:)\d+\n', '\\1*\n', value) + return re.sub(r'Stack trace:\n(.|\n)*', 'Stack trace:\n*', value) elif key == 'file': return re.sub(r'^.*[/\\](.*)', '\\1', value) else: |