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

Unified Diff: build/android/buildbot/bb_tests.py

Issue 11827031: Fix adb_logcat_monitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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/buildbot/bb_tests.py
diff --git a/build/android/buildbot/bb_tests.py b/build/android/buildbot/bb_tests.py
index 8f090cfee5e36faba6716862b31178f593c0ff40..dadfc3fbd311cf634644e443091a657083bd852f 100755
--- a/build/android/buildbot/bb_tests.py
+++ b/build/android/buildbot/bb_tests.py
@@ -52,21 +52,27 @@ INSTRUMENTATION_TESTS = dict((suite.name, suite) for suite in [
VALID_TESTS = set(['ui', 'unit', 'webkit', 'webkit_layout'])
-def RunCmd(command, flunk_on_failure=True):
- """Run a command relative to the chrome source root."""
-
+def SpawnCmd(command):
+ """Spawn a process without waiting for termination."""
# Add adb binary to path. In the future, might use build_internal copy.
env = dict(os.environ)
env['PATH'] = os.pathsep.join([
env['PATH'], os.path.join(constants.ANDROID_SDK_ROOT, 'platform-tools')])
+ print '>', ' '.join(map(pipes.quote, command))
+ sys.stdout.flush()
+ if TESTING:
+ class MockPopen(object):
+ @staticmethod
+ def wait():
+ return 0
+ return MockPopen()
- command_str = ' '.join(map(pipes.quote, command))
- print '>', command_str
- if not TESTING:
- code = subprocess.Popen(command, cwd=CHROME_SRC, env=env).wait()
- else:
- code = 0
- print '<', command_str
+ return subprocess.Popen(command, cwd=CHROME_SRC, env=env)
+
+def RunCmd(command, flunk_on_failure=True):
+ """Run a command relative to the chrome source root."""
+ code = SpawnCmd(command).wait()
+ print '<', ' '.join(map(pipes.quote, command))
if code != 0:
print 'ERROR: non-zero status %d from %s' % (code, command)
if flunk_on_failure:
@@ -166,9 +172,7 @@ def MainTestWrapper(options):
# Spawn logcat monitor
logcat_dir = os.path.join(CHROME_SRC, 'out/logcat')
shutil.rmtree(logcat_dir, ignore_errors=True)
- if not TESTING:
- subprocess.Popen(
- ['build/android/adb_logcat_monitor.py', logcat_dir], cwd=CHROME_SRC)
+ SpawnCmd(['build/android/adb_logcat_monitor.py', logcat_dir])
if 'unit' in options.test_filter:
RunTestSuites(options, None)
« 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