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

Unified Diff: buildbot/buildbot_run.py

Issue 321953005: [gyp][Android] Implement TestGypAndroid.run_built_executable. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 6 years, 6 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 | pylib/gyp/generator/android.py » ('j') | pylib/gyp/generator/android.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: buildbot/buildbot_run.py
diff --git a/buildbot/buildbot_run.py b/buildbot/buildbot_run.py
index cc3a25aedbd1de6384ede0e490ca9f3b7979ecb7..9d30a416bd205bfd5010862c94725d84d040edd9 100755
--- a/buildbot/buildbot_run.py
+++ b/buildbot/buildbot_run.py
@@ -107,6 +107,26 @@ def PrepareAndroidTree():
cwd=ANDROID_DIR)
+def StartAndroidEmulator():
+ """Start an android emulator from the built android tree."""
+ print '@@@BUILD_STEP Start Android emulator@@@'
+ subprocess.Popen(
+ ['/bin/bash', '-c',
+ 'source build/envsetup.sh && $ANDROID_HOST_OUT/bin/emulator'],
+ cwd=ANDROID_DIR)
+ CallSubProcess(
+ ['/bin/bash', '-c',
+ 'source build/envsetup.sh && $ANDROID_HOST_OUT/bin/adb wait-for-device'],
+ cwd=ANDROID_DIR)
+
+
+def StopAndroidEmulator():
+ """Stop all android emulators."""
+ print '@@@BUILD_STEP Stop Android emulator@@@'
+ # If this fails, it's because there is no emulator running.
+ subprocess.call(['pkill', 'emulator.*'])
+
+
def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
"""Run the gyp tests for a given format, emitting annotator tags.
@@ -160,7 +180,11 @@ def GypBuild():
# The Android gyp bot runs on linux so this must be tested first.
if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-android':
PrepareAndroidTree()
- retcode += GypTestFormat('android')
+ StartAndroidEmulator()
+ try:
+ retcode += GypTestFormat('android')
+ finally:
+ StopAndroidEmulator()
elif sys.platform.startswith('linux'):
retcode += GypTestFormat('ninja')
retcode += GypTestFormat('make')
« no previous file with comments | « no previous file | pylib/gyp/generator/android.py » ('j') | pylib/gyp/generator/android.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698