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

Unified Diff: build/android/test_runner.py

Issue 1358593002: [Android] Switch gtests to platform mode. (RELAND) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed Created 5 years, 3 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
Index: build/android/test_runner.py
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index 235d45bdaeb21f736467ff349579702e4fa06fb9..8088ad214db51601008a737897b0219a8d84eb28 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -32,8 +32,6 @@ from pylib.base import test_dispatcher
from pylib.base import test_instance_factory
from pylib.base import test_run_factory
from pylib.gtest import gtest_config
-# TODO(jbudorick): Remove this once we stop selectively enabling platform mode.
-from pylib.gtest import gtest_test_instance
from pylib.gtest import setup as gtest_setup
from pylib.gtest import test_options as gtest_test_options
from pylib.linker import setup as linker_setup
@@ -944,9 +942,7 @@ def RunTestsCommand(args, parser): # pylint: disable=too-many-return-statements
raise Exception('Failed to reset test server port.')
if command == 'gtest':
- if args.suite_name[0] in gtest_test_instance.BROWSER_TEST_SUITES:
- return RunTestsInPlatformMode(args, parser)
- return _RunGTests(args, devices)
+ return RunTestsInPlatformMode(args, parser)
elif command == 'linker':
return _RunLinkerTests(args, devices)
elif command == 'instrumentation':
@@ -975,13 +971,16 @@ _SUPPORTED_IN_PLATFORM_MODE = [
def RunTestsInPlatformMode(args, parser):
+ def infra_error(message):
+ parser.exit(status=constants.INFRA_EXIT_CODE, message=message)
+
if args.command not in _SUPPORTED_IN_PLATFORM_MODE:
- parser.error('%s is not yet supported in platform mode' % args.command)
+ infra_error('%s is not yet supported in platform mode' % args.command)
- with environment_factory.CreateEnvironment(args, parser.error) as env:
- with test_instance_factory.CreateTestInstance(args, parser.error) as test:
+ with environment_factory.CreateEnvironment(args, infra_error) as env:
+ with test_instance_factory.CreateTestInstance(args, infra_error) as test:
with test_run_factory.CreateTestRun(
- args, env, test, parser.error) as test_run:
+ args, env, test, infra_error) as test_run:
results = test_run.RunTests()
if args.environment == 'remote_device' and args.trigger:
« no previous file with comments | « build/android/pylib/local/device/local_device_test_run.py ('k') | testing/android/native_test/java/AndroidManifest.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698