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

Unified Diff: build/android/pylib/base/new_base_test_runner.py

Issue 12278020: [Android] Re-write the gtest TestRunner and introduce a new generic sharder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more frank nits Created 7 years, 10 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/base/shard.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/base/new_base_test_runner.py
diff --git a/build/android/pylib/base/base_test_runner.py b/build/android/pylib/base/new_base_test_runner.py
similarity index 93%
copy from build/android/pylib/base/base_test_runner.py
copy to build/android/pylib/base/new_base_test_runner.py
index a4172ddf33eac3d27932d7a48eced92ef10122fb..4e7d3443f6d0f1ef8c9949dbd372c6143adcb559 100644
--- a/build/android/pylib/base/base_test_runner.py
+++ b/build/android/pylib/base/new_base_test_runner.py
@@ -32,7 +32,7 @@ class BaseTestRunner(object):
the Run() method will set up tests, run them and tear them down.
"""
- def __init__(self, device, tool, shard_index, build_type):
+ def __init__(self, device, tool, build_type):
"""
Args:
device: Tests will run on the device of this ID.
@@ -48,7 +48,6 @@ class BaseTestRunner(object):
self.forwarder_base_url = ('http://localhost:%d' %
self._forwarder_device_port)
self.flags = FlagChanger(self.adb)
- self.shard_index = shard_index
self.flags.AddFlags(['--disable-fre'])
self._spawning_server = None
self._spawner_forwarder = None
@@ -66,17 +65,18 @@ class BaseTestRunner(object):
'%d:%d' % (self.test_server_spawner_port,
self.test_server_port))
- def Run(self):
- """Calls subclass functions to set up tests, run them and tear them down.
+ def Run(self, test):
+ """Calls subclass functions to set up test, run it and tear it down.
+
+ Args:
+ test: A Test to run.
Returns:
- Test results returned from RunTests().
+ Test results returned from RunTest(test).
"""
- if not self.HasTests():
- return True
self.SetUp()
try:
- return self.RunTests()
+ return self.RunTest(test)
finally:
self.TearDown()
@@ -84,12 +84,8 @@ class BaseTestRunner(object):
"""Called before tests run."""
Forwarder.KillDevice(self.adb, self.tool)
- def HasTests(self):
- """Whether the test suite has tests to run."""
- return True
-
- def RunTests(self):
- """Runs the tests. Need to be overridden."""
+ def RunTest(self, test):
+ """Runs the tests. Needs to be overridden."""
raise NotImplementedError
def TearDown(self):
« no previous file with comments | « no previous file | build/android/pylib/base/shard.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698