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

Unified Diff: tools/bots/dart2js_dump_info.py

Issue 506863002: Add support for running comparison of dart2js and dart2js with --dump-info output to the bots. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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 | « client/tools/buildbot_annotated_steps.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bots/dart2js_dump_info.py
===================================================================
--- tools/bots/dart2js_dump_info.py (revision 0)
+++ tools/bots/dart2js_dump_info.py (revision 0)
@@ -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)
+
Property changes on: tools/bots/dart2js_dump_info.py
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « client/tools/buildbot_annotated_steps.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698