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

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

Issue 22865020: [Android] Return error exit code if no devices are attached. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/base/test_dispatcher.py
diff --git a/build/android/pylib/base/test_dispatcher.py b/build/android/pylib/base/test_dispatcher.py
index 8ddd7acc602de5070c19ccf79ebae3ae631498d2..10b0b4bb88cef065200cef4509164ce298d1f46c 100644
--- a/build/android/pylib/base/test_dispatcher.py
+++ b/build/android/pylib/base/test_dispatcher.py
@@ -360,9 +360,8 @@ def RunTests(tests, runner_factory, wait_for_debugger, test_device,
A tuple of (base_test_result.TestRunResults object, exit code).
"""
if not tests:
- logging.error('No tests to run.')
+ logging.critical('No tests to run.')
return (base_test_result.TestRunResults(), constants.ERROR_EXIT_CODE)
-
if shard:
# Generate a shared _TestCollection object for all test runners, so they
# draw from a common pool of tests.
@@ -378,6 +377,9 @@ def RunTests(tests, runner_factory, wait_for_debugger, test_device,
log_string = 'replicated on each device'
devices = _GetAttachedDevices(wait_for_debugger, test_device)
+ if not devices:
+ logging.critical('No attached devices.')
+ return (base_test_result.TestRunResults(), constants.ERROR_EXIT_CODE)
logging.info('Will run %d tests (%s): %s', len(tests), log_string, str(tests))
runners = _CreateRunners(runner_factory, devices, setup_timeout)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698