Index: build/android/pylib/host_driven/test_case.py |
diff --git a/build/android/pylib/host_driven/test_case.py b/build/android/pylib/host_driven/test_case.py |
index e914b6717ae44eb064ad57c0429d33e2d5c0664d..8ff94083a395f7595357c96029838a39a99c74d9 100644 |
--- a/build/android/pylib/host_driven/test_case.py |
+++ b/build/android/pylib/host_driven/test_case.py |
@@ -25,6 +25,7 @@ import os |
import time |
from pylib import android_commands |
+from pylib import constants |
from pylib import forwarder |
from pylib import valgrind_tools |
from pylib.base import base_test_result |
@@ -48,28 +49,21 @@ class HostDrivenTestCase(object): |
test_name: The name of the method to run as the test. |
instrumentation_options: An InstrumentationOptions object. |
""" |
+ self.test_name = test_name |
class_name = self.__class__.__name__ |
- self.adb = None |
- self.cleanup_test_files = False |
- self.device_id = '' |
- self.has_forwarded_ports = False |
- self.instrumentation_options = instrumentation_options |
- self.ports_to_forward = [] |
- self.push_deps = False |
- self.shard_index = 0 |
- |
+ self.qualified_name = '%s.%s' % (class_name, self.test_name) |
# Use tagged_name when creating results, so that we can identify host-driven |
# tests in the overall results. |
- self.test_name = test_name |
- self.qualified_name = '%s.%s' % (class_name, self.test_name) |
self.tagged_name = '%s_%s' % (self._HOST_DRIVEN_TAG, self.qualified_name) |
+ self.instrumentation_options = instrumentation_options |
+ self.ports_to_forward = [] |
+ self.has_forwarded_ports = False |
+ |
# TODO(bulach): make ports_to_forward not optional and move the Forwarder |
# mapping here. |
def SetUp(self, device, shard_index, push_deps, |
- cleanup_test_files, ports_to_forward=None): |
- if not ports_to_forward: |
- ports_to_forward = [] |
+ cleanup_test_files, ports_to_forward=[]): |
self.device_id = device |
self.shard_index = shard_index |
self.adb = android_commands.AndroidCommands(self.device_id) |
@@ -81,13 +75,17 @@ class HostDrivenTestCase(object): |
def TearDown(self): |
pass |
+ # TODO(craigdh): Remove GetOutDir once references have been removed |
+ # downstream. |
+ def GetOutDir(self): |
+ return constants.GetOutDirectory() |
+ |
def Run(self): |
logging.info('Running host-driven test: %s', self.tagged_name) |
# Get the test method on the derived class and execute it |
return getattr(self, self.test_name)() |
- @staticmethod |
- def __GetHostForwarderLog(): |
+ def __GetHostForwarderLog(self): |
return ('-- Begin Full HostForwarder log\n' |
'%s\n' |
'--End Full HostForwarder log\n' % forwarder.Forwarder.GetHostLog()) |
@@ -153,7 +151,7 @@ class HostDrivenTestCase(object): |
start_ms = int(time.time()) * 1000 |
done = False |
for test_filter in test_filters: |
- tests = test_pkg.GetAllMatchingTests(None, None, test_filter) |
+ tests = test_pkg._GetAllMatchingTests(None, None, test_filter) |
# Filters should always result in >= 1 test. |
if len(tests) == 0: |
raise Exception('Java test filter "%s" returned no tests.' |