Index: build/android/pylib/instrumentation/dispatch.py |
diff --git a/build/android/pylib/instrumentation/dispatch.py b/build/android/pylib/instrumentation/dispatch.py |
index 81b59873c629c63a3d483f7743b18fb0640347a4..12d2b151e5a19d6523b3f0857de6de5bf1a8a6a4 100644 |
--- a/build/android/pylib/instrumentation/dispatch.py |
+++ b/build/android/pylib/instrumentation/dispatch.py |
@@ -8,10 +8,11 @@ import logging |
import os |
from pylib import android_commands |
+from pylib.base import shard |
from pylib.base import test_result |
import apk_info |
-import test_sharder |
+import test_runner |
def Dispatch(options, apks): |
@@ -71,16 +72,15 @@ def Dispatch(options, apks): |
tests = available_tests |
if not tests: |
- logging.warning('No Java tests to run with current args.') |
+ logging.warning('No instrumentation tests to run with current args.') |
return test_result.TestResults() |
tests *= options.number_of_runs |
attached_devices = android_commands.GetAttachedDevices() |
- test_results = test_result.TestResults() |
if not attached_devices: |
- raise Exception('You have no devices attached or visible!') |
+ raise Exception('You have no devices attached and visible!') |
frankf
2013/03/01 20:32:07
'There are no devices online.'
craigdh
2013/03/01 21:45:11
Done.
|
if options.device: |
attached_devices = [options.device] |
@@ -90,6 +90,10 @@ def Dispatch(options, apks): |
logging.warning('Coverage / debugger can not be sharded, ' |
'using first available device') |
attached_devices = attached_devices[:1] |
- sharder = test_sharder.TestSharder(attached_devices, options, tests, apks) |
- test_results = sharder.RunShardedTests() |
+ |
+ def TestRunnerFactory(device, shard_index): |
+ return test_runner.TestRunner(options, device, shard_index, False, apks, []) |
+ |
+ test_results = shard.ShardAndRunTests(TestRunnerFactory, attached_devices, |
+ tests, options.build_type) |
return test_results |
frankf
2013/03/01 20:32:07
no need for test_results, just return
craigdh
2013/03/01 21:45:11
Done.
|