am 6ec0e33e: am 1cd61741: Add support to run only tests in a given java package.

Merge commit '6ec0e33eeb4040494e4d6a3e260cdaf0c620eb83' into eclair-mr2-plus-aosp

* commit '6ec0e33eeb4040494e4d6a3e260cdaf0c620eb83':
  Add support to run only tests in a given java package.
This commit is contained in:
Brett Chabot
2009-10-22 10:58:09 -07:00
committed by Android Git Automerger

View File

@@ -41,6 +41,7 @@ class InstrumentationTestSuite(test_suite.AbstractTestSuite):
self._runner_name = self.DEFAULT_RUNNER
self._class_name = None
self._target_name = None
self._java_package = None
def GetPackageName(self):
return self._package_name
@@ -63,6 +64,14 @@ class InstrumentationTestSuite(test_suite.AbstractTestSuite):
self._class_name = class_name
return self
def GetJavaPackageFilter(self):
return self._java_package
def SetJavaPackageFilter(self, java_package_name):
"""Configure the suite to only run tests in given java package."""
self._java_package = java_package_name
return self
def GetTargetName(self):
"""Retrieve module that this test is targeting.
@@ -102,11 +111,18 @@ class InstrumentationTestSuite(test_suite.AbstractTestSuite):
if options.test_method is not None:
test_class = "%s#%s" % (test_class, options.test_method)
test_package = self.GetJavaPackageFilter()
if options.test_package:
test_package = options.test_package
if test_class and test_package:
logger.Log('Error: both class and java package options are specified')
instrumentation_args = {}
if test_class is not None:
instrumentation_args["class"] = test_class
if options.test_package:
instrumentation_args["package"] = options.test_package
if test_package:
instrumentation_args["package"] = test_package
if options.test_size:
instrumentation_args["size"] = options.test_size
if options.wait_for_debugger: