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

Side by Side 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. Created 6 years 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 unified diff | Download patch
« no previous file with comments | « mojo/tools/apptest_runner.py ('k') | mojo/tools/mopy/gtest_list_tests_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import re
6
7
5 def gtest_list_tests(gtest_list_tests_output): 8 def gtest_list_tests(gtest_list_tests_output):
6 """Returns a list of strings formatted as TestSuite.TestFixture from the 9 """Returns a list of strings formatted as TestSuite.TestFixture from the
7 output of running --gtest_list_tests on a GTEST application.""" 10 output of running --gtest_list_tests on a GTEST application."""
8 11
12 if not re.match("^(\w*\.\r?\n( \w*\r?\n)+)+", gtest_list_tests_output):
13 raise Exception("Unrecognized --gtest_list_tests output:\n%s" %
14 gtest_list_tests_output)
15
9 output_lines = gtest_list_tests_output.split('\n') 16 output_lines = gtest_list_tests_output.split('\n')
10 17
11 test_list = [] 18 test_list = []
12 for line in output_lines: 19 for line in output_lines:
13 if not line: 20 if not line:
14 continue 21 continue
15 if line[0] != ' ': 22 if line[0] != ' ':
16 suite = line.strip() 23 suite = line.strip()
17 continue 24 continue
18 test_list.append(suite + line.strip()) 25 test_list.append(suite + line.strip())
19 26
20 return test_list 27 return test_list
OLDNEW
« no previous file with comments | « mojo/tools/apptest_runner.py ('k') | mojo/tools/mopy/gtest_list_tests_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698