summaryrefslogtreecommitdiffstats
path: root/build/android
diff options
context:
space:
mode:
authorgkanwar@google.com <gkanwar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-11 11:49:33 +0000
committergkanwar@google.com <gkanwar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-11 11:49:33 +0000
commitf2eda3dfa1bfdecc30c5dff92fcade383a7b2341 (patch)
tree1af3e771213103e5920a91ca86544e2589be6bbd /build/android
parent245830504550a42fbd29ad636bff39b1f6bf341d (diff)
downloadchromium_src-f2eda3dfa1bfdecc30c5dff92fcade383a7b2341.zip
chromium_src-f2eda3dfa1bfdecc30c5dff92fcade383a7b2341.tar.gz
chromium_src-f2eda3dfa1bfdecc30c5dff92fcade383a7b2341.tar.bz2
Fixes dispatch files to return exit codes in several places
BUG=170477 Review URL: https://chromiumcodereview.appspot.com/19021003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211084 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/android')
-rw-r--r--build/android/pylib/browsertests/dispatch.py3
-rw-r--r--build/android/pylib/gtest/dispatch.py5
-rw-r--r--build/android/pylib/instrumentation/dispatch.py5
-rw-r--r--build/android/pylib/uiautomator/dispatch.py5
4 files changed, 11 insertions, 7 deletions
diff --git a/build/android/pylib/browsertests/dispatch.py b/build/android/pylib/browsertests/dispatch.py
index 3867dc3..1c8cfb4 100644
--- a/build/android/pylib/browsertests/dispatch.py
+++ b/build/android/pylib/browsertests/dispatch.py
@@ -12,6 +12,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.gtest import dispatch as gtest_dispatch
from pylib.gtest import test_runner
@@ -41,7 +42,7 @@ def Dispatch(options):
if not attached_devices:
logging.critical('A device must be attached and online.')
- return 1
+ return (base_test_result.TestRunResults(), constants.ERROR_EXIT_CODE)
# Reset the test port allocation. It's important to do it before starting
# to dispatch any tests.
diff --git a/build/android/pylib/gtest/dispatch.py b/build/android/pylib/gtest/dispatch.py
index cf30ffa..48b4816 100644
--- a/build/android/pylib/gtest/dispatch.py
+++ b/build/android/pylib/gtest/dispatch.py
@@ -212,9 +212,11 @@ def Dispatch(options):
Returns:
base_test_result.TestRunResults object with the results of running the tests
"""
+ results = base_test_result.TestRunResults()
+
if options.test_suite == 'help':
_ListTestSuites()
- return 0
+ return (results, 0)
if options.use_xvfb:
framebuffer = xvfb.Xvfb()
@@ -222,7 +224,6 @@ def Dispatch(options):
all_test_suites = _FullyQualifiedTestSuites(options.exe, options.test_suite,
options.build_type)
- results = base_test_result.TestRunResults()
exit_code = 0
for suite_name, suite_path in all_test_suites:
# Give each test suite its own copy of options.
diff --git a/build/android/pylib/instrumentation/dispatch.py b/build/android/pylib/instrumentation/dispatch.py
index df245c73..e4ca280 100644
--- a/build/android/pylib/instrumentation/dispatch.py
+++ b/build/android/pylib/instrumentation/dispatch.py
@@ -8,6 +8,7 @@ import logging
import os
from pylib import android_commands
+from pylib import constants
from pylib.base import base_test_result
from pylib.base import shard
from pylib.utils import report_results
@@ -36,8 +37,8 @@ def Dispatch(options):
tests = test_pkg._GetAllMatchingTests(
options.annotations, options.exclude_annotations, options.test_filter)
if not tests:
- logging.warning('No instrumentation tests to run with current args.')
- return base_test_result.TestRunResults()
+ logging.error('No instrumentation tests to run with current args.')
+ return (base_test_result.TestRunResults(), constants.ERROR_EXIT_CODE)
attached_devices = android_commands.GetAttachedDevices()
if not attached_devices:
diff --git a/build/android/pylib/uiautomator/dispatch.py b/build/android/pylib/uiautomator/dispatch.py
index 3837af8..fafb2ac 100644
--- a/build/android/pylib/uiautomator/dispatch.py
+++ b/build/android/pylib/uiautomator/dispatch.py
@@ -8,6 +8,7 @@ import logging
import os
from pylib import android_commands
+from pylib import constants
from pylib.base import base_test_result
from pylib.base import shard
from pylib.utils import report_results
@@ -36,8 +37,8 @@ def Dispatch(options):
tests = test_pkg._GetAllMatchingTests(
options.annotations, options.exclude_annotations, options.test_filter)
if not tests:
- logging.warning('No uiautomator tests to run with current args.')
- return base_test_result.TestRunResults()
+ logging.error('No uiautomator tests to run with current args.')
+ return (base_test_result.TestRunResults(), constants.ERROR_EXIT_CODE)
attached_devices = android_commands.GetAttachedDevices()
if not attached_devices: