Added tools/bots/editor.py to build the editor (using gyp/build.py) and run editor tests

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20319 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
kustermann@google.com 2013-03-21 15:25:38 +00:00
parent a068ae2328
commit 538c35dd52
3 changed files with 75 additions and 11 deletions

View file

@ -1,9 +1,8 @@
#!/usr/bin/python
# Copyright (c) 2011, 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.
#!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@ -100,12 +99,6 @@ def ProcessTools(mode, name, version):
# get the latest changed revision from the current repository sub-tree
version = GetLatestChangedRevision()
#TODO: debug statements to be removed in the future.
print "mode = " + mode
print "name = " + name
print "version = " + version
print "toolsBuildScript = " + os.path.abspath(toolsBuildScript)
utils = GetUtils()
outdir = GetOutDir(utils, mode)
cmds = [sys.executable, toolsBuildScript,
@ -184,8 +177,6 @@ def GetLatestChangedRevision():
return svnRev
def main():
print 'main'
if len(sys.argv) == 0:
print 'Script pathname not known, giving up.'
return 1
@ -208,7 +199,18 @@ def main():
# root directory, set JAVA_HOME based on that.
FixJavaHome()
if name.startswith('dart-editor'):
status = ProcessTools('release', name, version)
# TODO(kustermann,ricow): This is a temporary hack until we can safely
# enable it on main waterfall. We need to remove this eventually
is_fyi = False
if name.startswith('dart-editor-fyi'):
match = re.search('dart-editor-fyi(.*)', name)
name = 'dart-editor' + match.group(1)
is_fyi = True
# Run the old annotated steps script first.
status = ProcessTools('release', name, version) or status
# In case we're an FYI builder, run 'tools/bots/editor.py' as well
if is_fyi:
status = ProcessBot(name, 'editor')
elif name.startswith('pub-'):
status = ProcessBot(name, 'pub')
elif name.startswith('vm-android'):

View file

@ -86,10 +86,12 @@ class BuildStep(object):
def __enter__(self):
print '@@@BUILD_STEP %s@@@' % self.name
sys.stdout.flush()
def __exit__(self, type, value, traceback):
if value:
print '@@@STEP_FAILURE@@@'
sys.stdout.flush()
if self.swallow_error and isinstance(value, OSError):
return True

60
tools/bots/editor.py Executable file
View file

@ -0,0 +1,60 @@
#!/usr/bin/python
# Copyright (c) 2013, 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.
import os
import sys
import bot
def GetEditorExecutable(mode, arch):
configuration_dir = mode + arch.upper()
linux_path = os.path.join('out', configuration_dir, 'editor')
win_path = os.path.join('build', configuration_dir, 'editor')
mac_path = os.path.join('xcodebuild', configuration_dir, 'editor')
if sys.platform == 'darwin':
executable = os.path.join('DartEditor.app', 'Contents', 'MacOS',
'DartEditor')
# TODO(kustermann,ricow): Maybe we're able to get rid of this in the future.
# We use ninja on bots which use out/ instead of xcodebuild/
if os.path.exists(linux_path) and os.path.isdir(linux_path):
return os.path.join(linux_path, executable)
else:
return os.path.join(mac_path, executable)
elif sys.platform == 'win32':
return os.path.join(win_path, 'DartEditor.exe')
elif sys.platform == 'linux2':
return os.path.join(linux_path, 'DartEditor')
else:
raise Exception('Unknown platform %s' % sys.platform)
def main():
build_py = os.path.join('tools', 'build.py')
architectures = ['ia32', 'x64']
test_architectures = ['x64']
for arch in architectures:
with bot.BuildStep('Build Editor %s' % arch):
args = [sys.executable, build_py,
'-mrelease', '--arch=%s' % arch, 'editor']
print 'Running: %s' % (' '.join(args))
sys.stdout.flush()
bot.RunProcess(args)
for arch in test_architectures:
editor_executable = GetEditorExecutable('Release', arch)
with bot.BuildStep('Test Editor %s' % arch):
args = [editor_executable, '--test', '--auto-exit']
print 'Running: %s' % (' '.join(args))
sys.stdout.flush()
bot.RunProcess(args)
return 0
if __name__ == '__main__':
try:
sys.exit(main())
except OSError as e:
sys.exit(e.errno)