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

Unified Diff: build/android/pylib/host_driven/test_case.py

Issue 23726004: Add test_server_setup.py and add support for additional flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed permissions Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/pylib/host_driven/test_server.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3387c948bdda3bb30a0686204faefb3f64b8e526..7ce1c307827d6ca6de6f7c1e513bea86d0795dae 100644
--- a/build/android/pylib/host_driven/test_case.py
+++ b/build/android/pylib/host_driven/test_case.py
@@ -77,12 +77,13 @@ class HostDrivenTestCase(object):
# Get the test method on the derived class and execute it
return getattr(self, self.test_name)()
- def __RunJavaTest(self, test, test_pkg):
+ def __RunJavaTest(self, test, test_pkg, additional_flags=None):
"""Runs a single Java test in a Java TestRunner.
Args:
test: Fully qualified test name (ex. foo.bar.TestClass#testMethod)
test_pkg: TestPackage object.
+ additional_flags: A list of additional flags to add to the command line.
Returns:
TestRunResults object with a single test result.
@@ -90,14 +91,15 @@ class HostDrivenTestCase(object):
java_test_runner = test_runner.TestRunner(self.instrumentation_options,
self.device_id,
self.shard_index, test_pkg,
- self.ports_to_forward)
+ self.ports_to_forward,
+ additional_flags=additional_flags)
try:
java_test_runner.SetUp()
return java_test_runner.RunTest(test)[0]
finally:
java_test_runner.TearDown()
- def _RunJavaTestFilters(self, test_filters):
+ def _RunJavaTestFilters(self, test_filters, additional_flags=None):
"""Calls a list of tests and stops at the first test failure.
This method iterates until either it encounters a non-passing test or it
@@ -109,6 +111,7 @@ class HostDrivenTestCase(object):
Args:
test_filters: A list of Java test filters.
+ additional_flags: A list of addition flags to add to the command line.
Returns:
A TestRunResults object containing an overall result for this set of Java
@@ -132,7 +135,7 @@ class HostDrivenTestCase(object):
for test in tests:
# We're only running one test at a time, so this TestRunResults object
# will hold only one result.
- java_result = self.__RunJavaTest(test, test_pkg)
+ java_result = self.__RunJavaTest(test, test_pkg, additional_flags)
assert len(java_result.GetAll()) == 1
if not java_result.DidRunPass():
result = java_result.GetNotPass().pop()
« no previous file with comments | « no previous file | build/android/pylib/host_driven/test_server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698