Fixes dispatch files to return exit codes in several places
BUG=170477 Review URL: https://chromiumcodereview.appspot.com/19021003 git-svn-id: http://src.chromium.org/svn/trunk/src/build@211084 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
Родитель
9a4b358aa2
Коммит
383770ce5d
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче