Chromium Code Reviews| Index: tools/bots/editor.py |
| diff --git a/tools/bots/editor.py b/tools/bots/editor.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..01f034fecddda5e010947a0554d30fbc93d430b0 |
| --- /dev/null |
| +++ b/tools/bots/editor.py |
| @@ -0,0 +1,61 @@ |
| +#!/usr/bin/python |
| + |
|
ricow1
2013/03/21 15:13:05
remove blank line
kustermann
2013/03/21 15:24:48
Done.
|
| +# 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') |
|
ricow1
2013/03/21 15:13:05
I am fine with us experimenting with this in this
kustermann
2013/03/21 15:24:48
I know, it should be
* ./tools/build.py -mrelease
|
| + 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(mac_path, executable) |
| + else: |
| + return os.path.join(mac_path, executable) |
|
ricow1
2013/03/21 15:13:05
we do the same thing in both the if and the else
kustermann
2013/03/21 15:24:48
Thanks for catching this.
|
| + 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) |