Add support for running comparison of dart2js and dart2js with --dump-info output to the bots.

This will compile with and without the flag, and compare the compiled output files (ignoring the json files).

If you patch this in you can run this locally by doing:

BUILDBOT_BUILDERNAME=dart2js-dump-info client/tools/buildbot_annotated_steps.py
or
BUILDBOT_BUILDERNAME=dart2js-dump-info python tools/bots/dart2js_dump_info.py
R=whesse@google.com

Review URL: https://codereview.chromium.org//506863002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39546 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
ricow@google.com 2014-08-26 11:05:58 +00:00
parent bd446408ea
commit e32a17b162
2 changed files with 77 additions and 0 deletions

View file

@ -201,6 +201,8 @@ def main():
status = ProcessBot(name, 'functional_testing')
elif name.startswith('version-checker'):
status = ProcessBot(name, 'version_checker')
elif name.startswith('dart2js-dump-info'):
status = ProcessBot(name, 'dart2js_dump_info')
else:
status = ProcessBot(name, 'compiler')

View file

@ -0,0 +1,75 @@
#!/usr/bin/python
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""
Buildbot steps for testing dart2js with --dump-info turned on
"""
import os
import shutil
import sys
import bot
import bot_utils
utils = bot_utils.GetUtils()
HOST_OS = utils.GuessOS()
def DumpConfig(name, is_buildbot):
"""Returns info for the current buildbot.
We only run this bot on linux, so all of this is just hard coded.
"""
return bot.BuildInfo('none', 'none', 'release', 'linux')
def Run(args):
print "Running: %s" % ' '.join(args)
sys.stdout.flush()
bot.RunProcess(args)
def DumpSteps(build_info):
build_root = utils.GetBuildRoot(HOST_OS, mode='release', arch='ia32')
compilations_dir = os.path.join(bot_utils.DART_DIR,
build_root,
'generated_compilations')
tests = ['html', 'samples']
with bot.BuildStep('Cleaning out old compilations'):
print "Cleaning out %s" % compilations_dir
shutil.rmtree(compilations_dir, ignore_errors=True)
with utils.TempDir() as temp_dir:
normal_compilations = os.path.join(temp_dir, 'normal')
dump_compilations = os.path.join(temp_dir, 'dump')
normal_compilation_command = [sys.executable, './tools/test.py',
'--mode=' + build_info.mode,
'-cdart2js', '-rnone'] + tests
with bot.BuildStep('Compiling without dump info'):
Run(normal_compilation_command)
pass
with bot.BuildStep('Store normal compilation artifacts'):
args = ['mv', compilations_dir, normal_compilations]
Run(args)
with bot.BuildStep('Compiling with dump info'):
args = normal_compilation_command + ['--dart2js-options=--dump-info']
Run(args)
with bot.BuildStep('Store normal compilation artifacts'):
args = ['mv', compilations_dir, dump_compilations]
Run(args)
with bot.BuildStep('Compare outputs'):
args = ['diff', '-rq', '-x', '*\.json',
normal_compilations, dump_compilations]
# Diff will return non zero and we will throw if there are any differences
Run(args)
with bot.BuildStep('Validate dump files'):
# Do whatever you like :-), files are in dump_compilations
pass
if __name__ == '__main__':
bot.RunBot(DumpConfig, DumpSteps)