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

Unified Diff: build/android/run_tests.py

Issue 11801016: [Android] Break GTest emulator launching into a separate function. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 11 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/run_tests.py
diff --git a/build/android/run_tests.py b/build/android/run_tests.py
index aa4e7dc482e73ae73da6febe95dc3f4f32f758c7..8d0b05535c8b0a60da4fff712282b9b2f124ad70 100755
--- a/build/android/run_tests.py
+++ b/build/android/run_tests.py
@@ -107,6 +107,32 @@ def FullyQualifiedTestSuites(exe, option_test_suite, build_type):
return qualified_test_suites
+def LaunchEmulators(emulator_count, fast_and_loose=False):
frankf 2013/01/07 18:27:23 I recall fast_and_loose option causing more harm t
craigdh 2013/01/07 22:50:41 Filed http://crbug.com/168653 and assigned it to m
+ """Launch multiple emulators and wait for them to boot.
+
+ Args:
+ emulator_count: number of emulators to launch.
+
+ Returns:
+ List of emulators.
+ """
+ emulators = []
+ for n in xrange(emulator_count):
+ t = time_profile.TimeProfile('Emulator launch %d' % n)
+ avd_name = None
+ if n > 0:
+ # Creates a temporary AVD for the extra emulators.
+ avd_name = 'run_tests_avd_%d' % n
+ emu = emulator.Emulator(avd_name, fast_and_loose)
frankf 2013/01/07 18:27:23 Is there any kind of logging done by the emulator
craigdh 2013/01/07 22:50:41 The emulator module logs at the info level already
+ emu.Launch(kill_all_emulators=n == 0)
+ t.Stop()
+ emulators.append(emu)
+ # Wait for all emulators to boot completed.
+ for emu in emulators:
+ emu.ConfirmLaunch(True)
+ return emulators
+
+
class TestSharder(BaseTestSharder):
"""Responsible for sharding the tests on the connected devices."""
@@ -247,20 +273,9 @@ def _RunATestSuite(options):
buildbot_emulators = []
if options.use_emulator:
- for n in range(options.emulator_count):
- t = time_profile.TimeProfile('Emulator launch %d' % n)
- avd_name = None
- if n > 0:
- # Creates a temporary AVD for the extra emulators.
- avd_name = 'run_tests_avd_%d' % n
- buildbot_emulator = emulator.Emulator(avd_name, options.fast_and_loose)
- buildbot_emulator.Launch(kill_all_emulators=n == 0)
- t.Stop()
- buildbot_emulators.append(buildbot_emulator)
- attached_devices.append(buildbot_emulator.device)
- # Wait for all emulators to boot completed.
- map(lambda buildbot_emulator: buildbot_emulator.ConfirmLaunch(True),
- buildbot_emulators)
+ buildbot_emulators = LaunchEmulators(options.emulator_count,
+ fast_and_loose=options.fast_and_loose)
+ attached_devices = [e.device for e in buildbot_emulators]
elif options.test_device:
attached_devices = [options.test_device]
else:
« 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