[Android] Refactor buildbot tests so that they can be used downstream.

I refactored in the wrong way in r211209 (https://chromiumcodereview.appspot.com/18325030/). This CL fixes that. Note that r211209 is not broken; it is just not usable downstream.

BUG=249997
NOTRY=True

Review URL: https://chromiumcodereview.appspot.com/18202005

git-svn-id: http://src.chromium.org/svn/trunk/src/build@211454 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
sivachandra@chromium.org 2013-07-12 21:05:48 +00:00
Родитель 432ba7d5c8
Коммит d70217d122
1 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -11,24 +11,24 @@ BUILDBOT_DIR = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(BUILDBOT_DIR) sys.path.append(BUILDBOT_DIR)
import bb_run_bot import bb_run_bot
def RunBotsWithTesting(bot_step_map): def RunBotProcesses(bot_process_map):
code = 0 code = 0
procs = [ for bot, proc in bot_process_map:
(bot, subprocess.Popen(
[os.path.join(BUILDBOT_DIR, 'bb_run_bot.py'), '--bot-id', bot,
'--testing'], stdout=subprocess.PIPE, stderr=subprocess.PIPE))
for bot in bot_step_map]
for bot, proc in procs:
_, err = proc.communicate() _, err = proc.communicate()
code |= proc.returncode code |= proc.returncode
if proc.returncode != 0: if proc.returncode != 0:
print 'Error running bb_run_bot with id="%s"' % bot, err print 'Error running the bot script with id="%s"' % bot, err
return code return code
def main(): def main():
return RunBotsWithTesting(bb_run_bot.GetBotStepMap()) procs = [
(bot, subprocess.Popen(
[os.path.join(BUILDBOT_DIR, 'bb_run_bot.py'), '--bot-id', bot,
'--testing'], stdout=subprocess.PIPE, stderr=subprocess.PIPE))
for bot in bb_run_bot.GetBotStepMap()]
return RunBotProcesses(procs)
if __name__ == '__main__': if __name__ == '__main__':