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

Unified Diff: build/android/run_browser_tests.py

Issue 12263024: Android: Add test runner scripts to run content_browsertests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « build/android/pylib/gtest/test_runner.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/run_browser_tests.py
diff --git a/build/android/run_browser_tests.py b/build/android/run_browser_tests.py
new file mode 100755
index 0000000000000000000000000000000000000000..a329f6aece33c94fd986ce226879c1912744267c
--- /dev/null
+++ b/build/android/run_browser_tests.py
@@ -0,0 +1,80 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Runs content browser tests."""
+
+import logging
+import optparse
+import os
+import sys
+
+from pylib import android_commands
+from pylib import cmd_helper
+from pylib import ports
+from pylib.browsertests import test_sharder
+from pylib.utils import run_tests_helper
+from pylib.utils import test_options_parser
+
+CONTENT_BROWSERTEST_SUITENAME = 'content_browsertests'
+
+
+def _RunContentBrowserTestSuite(options):
frankf 2013/02/15 02:10:02 Let's move this to browsertests.dispatch similar t
+ attached_devices = []
+ if options.test_device:
+ attached_devices = [options.test_device]
+ else:
+ attached_devices = android_commands.GetAttachedDevices()
+
+ if not attached_devices:
+ logging.critical('A device must be attached and online.')
+ return 1
+
+ if options.gtest_filter:
+ logging.warning('Sharding is not possible with these configurations.')
+ attached_devices = [attached_devices[0]]
+
+ # Reset the test port allocation. It's important to do it before starting
+ # to dispatch any tests.
+ if not ports.ResetTestServerPortAllocation():
+ raise Exception('Failed to reset test server port.')
+
+ test_suite_dir = os.path.join(cmd_helper.OutDirectory.get(),
+ options.build_type)
+ options.test_suite = os.path.join(test_suite_dir,
+ 'apks',
+ CONTENT_BROWSERTEST_SUITENAME + '.apk')
+ sharder = test_sharder.TestSharder(
+ attached_devices,
+ options.test_suite,
+ options.gtest_filter,
+ options.test_arguments,
+ options.timeout,
+ options.cleanup_test_files,
+ options.tool,
+ options.build_type)
+
+ test_results = sharder.RunShardedTests()
+ test_results.LogFull(
+ test_type='Unit test',
+ test_package=CONTENT_BROWSERTEST_SUITENAME,
+ build_type=options.build_type,
+ flakiness_server=options.flakiness_dashboard_server)
+ test_results.PrintAnnotation()
+
+def main(argv):
+ option_parser = optparse.OptionParser()
+ test_options_parser.AddGTestOptions(option_parser)
+ options, args = option_parser.parse_args(argv)
+
+ if len(args) > 1:
+ option_parser.error('Unknown argument: %s' % args[1:])
+
+ run_tests_helper.SetLogLevel(options.verbose_count)
+ return _RunContentBrowserTestSuite(options)
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
« no previous file with comments | « build/android/pylib/gtest/test_runner.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698