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

Side by Side Diff: build/android/pylib/host_driven/test_info_collection.py

Issue 144183004: Convert to gtest-style filtering in instrumentation tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 months 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
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Module containing information about the host-driven tests.""" 5 """Module containing information about the host-driven tests."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import re
9 10
10 import tests_annotations 11 import tests_annotations
11 12
12 13
13 class TestInfo(object): 14 class TestInfo(object):
14 """An object containing and representing a test function, plus metadata.""" 15 """An object containing and representing a test function, plus metadata."""
15 16
16 def __init__(self, runnable, set_up=None, tear_down=None): 17 def __init__(self, runnable, set_up=None, tear_down=None):
17 # The actual test function/method. 18 # The actual test function/method.
18 self.runnable = runnable 19 self.runnable = runnable
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 This is a case-sensitive, substring comparison: 'Foo' will match methods 135 This is a case-sensitive, substring comparison: 'Foo' will match methods
135 Foo.testBar and Bar.testFoo. 'foo' would not match either. 136 Foo.testBar and Bar.testFoo. 'foo' would not match either.
136 137
137 Args: 138 Args:
138 test_info: TestInfo object representing the test 139 test_info: TestInfo object representing the test
139 name_filter: substring to check for in the qualified name of the test 140 name_filter: substring to check for in the qualified name of the test
140 141
141 Returns: 142 Returns:
142 True if no name filter supplied or it matches; False otherwise. 143 True if no name filter supplied or it matches; False otherwise.
143 """ 144 """
144 return not name_filter or name_filter in test_info.qualified_name 145 return not name_filter or re.search(name_filter, test_info.qualified_name)
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/test_jar.py » ('j') | build/android/pylib/instrumentation/test_jar.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698