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

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

Issue 404993004: [Android] Switch to DeviceUtils versions of GetMemoryUsageForPid and __str__. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comment from frankf Created 6 years, 5 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 """Runs host-driven tests on a particular device.""" 5 """Runs host-driven tests on a particular device."""
6 6
7 import logging 7 import logging
8 import sys 8 import sys
9 import time 9 import time
10 import traceback 10 import traceback
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 A TestRunResults object which contains the result produced by the test 78 A TestRunResults object which contains the result produced by the test
79 and, in the case of a failure, the test that should be retried. 79 and, in the case of a failure, the test that should be retried.
80 """ 80 """
81 81
82 assert isinstance(test, test_case.HostDrivenTestCase) 82 assert isinstance(test, test_case.HostDrivenTestCase)
83 83
84 start_date_ms = int(time.time()) * 1000 84 start_date_ms = int(time.time()) * 1000
85 exception_raised = False 85 exception_raised = False
86 86
87 try: 87 try:
88 test.SetUp(self.device.old_interface.GetDevice(), self.shard_index, 88 test.SetUp(str(self.device), self.shard_index,
89 self._push_deps, self._cleanup_test_files) 89 self._push_deps, self._cleanup_test_files)
90 except Exception: 90 except Exception:
91 logging.exception( 91 logging.exception(
92 'Caught exception while trying to run SetUp() for test: ' + 92 'Caught exception while trying to run SetUp() for test: ' +
93 test.tagged_name) 93 test.tagged_name)
94 # Tests whose SetUp() method has failed are likely to fail, or at least 94 # Tests whose SetUp() method has failed are likely to fail, or at least
95 # yield invalid results. 95 # yield invalid results.
96 exc_info = sys.exc_info() 96 exc_info = sys.exc_info()
97 results = base_test_result.TestRunResults() 97 results = base_test_result.TestRunResults()
98 results.AddResult(HostDrivenExceptionTestResult( 98 results.AddResult(HostDrivenExceptionTestResult(
(...skipping 25 matching lines...) Expand all
124 # until the test is fixed. 124 # until the test is fixed.
125 exc_info = sys.exc_info() 125 exc_info = sys.exc_info()
126 results = base_test_result.TestRunResults() 126 results = base_test_result.TestRunResults()
127 results.AddResult(HostDrivenExceptionTestResult( 127 results.AddResult(HostDrivenExceptionTestResult(
128 test.tagged_name, start_date_ms, exc_info)) 128 test.tagged_name, start_date_ms, exc_info))
129 129
130 if not results.DidRunPass(): 130 if not results.DidRunPass():
131 return results, test 131 return results, test
132 else: 132 else:
133 return results, None 133 return results, None
OLDNEW
« no previous file with comments | « build/android/pylib/gtest/test_runner.py ('k') | build/android/pylib/instrumentation/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698