Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1307)

Unified Diff: mojo/tools/mopy/gtest_list_tests.py

Issue 741323002: Handle and surface application test failures. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Address comments, add tests. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/tools/mopy/gtest_list_tests.py
diff --git a/mojo/tools/mopy/gtest_list_tests.py b/mojo/tools/mopy/gtest_list_tests.py
index 8b3369d20451ed5b41b728a770849e595564ff9b..8209280c9144d2da538d20b31287b29c1cea334e 100644
--- a/mojo/tools/mopy/gtest_list_tests.py
+++ b/mojo/tools/mopy/gtest_list_tests.py
@@ -2,10 +2,17 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import re
+
+
def gtest_list_tests(gtest_list_tests_output):
"""Returns a list of strings formatted as TestSuite.TestFixture from the
output of running --gtest_list_tests on a GTEST application."""
+ if not re.match("^(\w*\.\r?\n( \w*\r?\n)+)+", gtest_list_tests_output):
+ raise Exception ("Unrecognized --gtest_list_tests output:\n%s" %
viettrungluu 2014/11/24 20:22:58 nit: No space before '('.
msw 2014/11/24 20:47:31 Done.
+ gtest_list_tests_output)
+
output_lines = gtest_list_tests_output.split('\n')
test_list = []

Powered by Google App Engine
This is Rietveld 408576698