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

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

Issue 1292053006: Revert of [Android] Add --blacklist-file as a command-line option. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Base class for host-driven test cases. 5 """Base class for host-driven test cases.
6 6
7 This test case is intended to serve as the base class for any host-driven 7 This test case is intended to serve as the base class for any host-driven
8 test cases. It is similar to the Python unitttest module in that test cases 8 test cases. It is similar to the Python unitttest module in that test cases
9 inherit from this class and add methods which will be run as tests. 9 inherit from this class and add methods which will be run as tests.
10 10
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 log = '' 148 log = ''
149 149
150 test_pkg = test_package.TestPackage( 150 test_pkg = test_package.TestPackage(
151 self.instrumentation_options.test_apk_path, 151 self.instrumentation_options.test_apk_path,
152 self.instrumentation_options.test_apk_jar_path, 152 self.instrumentation_options.test_apk_jar_path,
153 self.instrumentation_options.test_support_apk_path) 153 self.instrumentation_options.test_support_apk_path)
154 154
155 start_ms = int(time.time()) * 1000 155 start_ms = int(time.time()) * 1000
156 done = False 156 done = False
157 for test_filter in test_filters: 157 for test_filter in test_filters:
158 tests = test_pkg.GetAllMatchingTests( 158 tests = test_pkg.GetAllMatchingTests(None, None, test_filter)
159 None, None, test_filter, [self.device])
160 # Filters should always result in >= 1 test. 159 # Filters should always result in >= 1 test.
161 if len(tests) == 0: 160 if len(tests) == 0:
162 raise Exception('Java test filter "%s" returned no tests.' 161 raise Exception('Java test filter "%s" returned no tests.'
163 % test_filter) 162 % test_filter)
164 for test in tests: 163 for test in tests:
165 # We're only running one test at a time, so this TestRunResults object 164 # We're only running one test at a time, so this TestRunResults object
166 # will hold only one result. 165 # will hold only one result.
167 java_result = self.__RunJavaTest(test, test_pkg, additional_flags) 166 java_result = self.__RunJavaTest(test, test_pkg, additional_flags)
168 assert len(java_result.GetAll()) == 1 167 assert len(java_result.GetAll()) == 1
169 if not java_result.DidRunPass(): 168 if not java_result.DidRunPass():
(...skipping 11 matching lines...) Expand all
181 overall_result.AddResult( 180 overall_result.AddResult(
182 test_result.InstrumentationTestResult( 181 test_result.InstrumentationTestResult(
183 self.tagged_name, test_type, start_ms, duration_ms, log=log)) 182 self.tagged_name, test_type, start_ms, duration_ms, log=log))
184 return overall_result 183 return overall_result
185 184
186 def __str__(self): 185 def __str__(self):
187 return self.tagged_name 186 return self.tagged_name
188 187
189 def __repr__(self): 188 def __repr__(self):
190 return self.tagged_name 189 return self.tagged_name
OLDNEW
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | build/android/pylib/instrumentation/setup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698