| Index: build/android/pylib/gtest/dispatch.py
|
| diff --git a/build/android/pylib/gtest/dispatch.py b/build/android/pylib/gtest/dispatch.py
|
| index 3c11c00f3b3d358cd7c9bef326708e7989ca733a..c1f46e46380aff4ccc23110051cd28fd108be619 100644
|
| --- a/build/android/pylib/gtest/dispatch.py
|
| +++ b/build/android/pylib/gtest/dispatch.py
|
| @@ -13,6 +13,7 @@ from pylib import android_commands
|
| from pylib import cmd_helper
|
| from pylib import constants
|
| from pylib import ports
|
| +from pylib.base import base_test_result
|
| from pylib.base import shard
|
| from pylib.utils import emulator
|
| from pylib.utils import report_results
|
| @@ -35,6 +36,9 @@ def _FullyQualifiedTestSuites(exe, option_test_suite, build_type):
|
| Ex. ('content_unittests',
|
| '/tmp/chrome/src/out/Debug/content_unittests_apk/'
|
| 'content_unittests-debug.apk')
|
| +
|
| + Raises:
|
| + Exception: If test suite not found.
|
| """
|
| def GetQualifiedSuite(suite):
|
| if suite.is_suite_exe:
|
| @@ -93,7 +97,8 @@ def GetAllEnabledTests(runner_factory, devices):
|
| Returns:
|
| List of all enabled tests.
|
|
|
| - Raises Exception if all devices failed.
|
| + Raises:
|
| + Exception: If no devices available.
|
| """
|
| for device in devices:
|
| try:
|
| @@ -118,7 +123,10 @@ def _RunATestSuite(options, suite_name):
|
| suite_name: name of the test suite being run.
|
|
|
| Returns:
|
| - 0 if successful, number of failing tests otherwise.
|
| + base_test_result.TestRunResult object with the test results
|
| +
|
| + Raises:
|
| + Exception: If device not attached, or failed to reset test server port.
|
| """
|
| step_name = os.path.basename(options.test_suite).replace('-debug.apk', '')
|
| attached_devices = []
|
| @@ -183,7 +191,7 @@ def _RunATestSuite(options, suite_name):
|
| for buildbot_emulator in buildbot_emulators:
|
| buildbot_emulator.Shutdown()
|
|
|
| - return len(test_results.GetNotPass())
|
| + return test_results
|
|
|
|
|
| def _ListTestSuites():
|
| @@ -203,7 +211,7 @@ def Dispatch(options):
|
| options: options for running the tests.
|
|
|
| Returns:
|
| - 0 if successful, number of failing tests otherwise.
|
| + base_test_result.TestRunResults object with the results of running the tests
|
| """
|
| if options.test_suite == 'help':
|
| _ListTestSuites()
|
| @@ -215,13 +223,14 @@ def Dispatch(options):
|
|
|
| all_test_suites = _FullyQualifiedTestSuites(options.exe, options.test_suite,
|
| options.build_type)
|
| - failures = 0
|
| + results = base_test_result.TestRunResults()
|
| for suite_name, suite_path in all_test_suites:
|
| # Give each test suite its own copy of options.
|
| test_options = copy.deepcopy(options)
|
| test_options.test_suite = suite_path
|
| - failures += _RunATestSuite(test_options, suite_name)
|
| + results.AddTestRunResults(_RunATestSuite(test_options, suite_name))
|
|
|
| if options.use_xvfb:
|
| framebuffer.Stop()
|
| - return failures
|
| +
|
| + return results
|
|
|