summaryrefslogtreecommitdiff
path: root/buildbot
diff options
context:
space:
mode:
authorbradnelson@google.com <bradnelson@google.com@78cadc50-ecff-11dd-a971-7dbc132099af>2011-04-01 22:55:24 +0000
committerbradnelson@google.com <bradnelson@google.com@78cadc50-ecff-11dd-a971-7dbc132099af>2011-04-01 22:55:24 +0000
commitcbfc497b03c0bd2c6bafb0be388b21ee72b73bdb (patch)
tree53e114366898acff79a983b67f3e203be4d3a86a /buildbot
parentda955239e6a1b5e005207c389a88039e3ebd415f (diff)
downloadgyp-cbfc497b03c0bd2c6bafb0be388b21ee72b73bdb.tar.gz
Adding buildbot annotator script to drive the build and annotate sections
on the buildbot. This will let of change the gyp waterfall with in project changes. BUG=None TEST=None R=jeanluc@google.com Review URL: http://codereview.chromium.org/6788019 git-svn-id: http://gyp.googlecode.com/svn/trunk@908 78cadc50-ecff-11dd-a971-7dbc132099af
Diffstat (limited to 'buildbot')
-rwxr-xr-xbuildbot/buildbot_run.py71
1 files changed, 71 insertions, 0 deletions
diff --git a/buildbot/buildbot_run.py b/buildbot/buildbot_run.py
new file mode 100755
index 00000000..22d3985c
--- /dev/null
+++ b/buildbot/buildbot_run.py
@@ -0,0 +1,71 @@
+#!/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.
+
+
+"""Argument-less script to select what to run on the buildbots."""
+
+
+import os
+import subprocess
+import sys
+
+
+def GypTestFormat(title, format, msvs_version=None):
+ """Run the gyp tests for a given format, emitting annotator tags.
+
+ See annotator docs at:
+ https://sites.google.com/a/chromium.org/dev/developers/testing/chromium-build-infrastructure/buildbot-annotations
+ Args:
+ format: gyp format to test.
+ Returns:
+ 0 for sucesss, 1 for failure.
+ """
+ print '@@@BUILD_STEP ' + title + '@@@'
+ buildbot_dir = os.path.dirname(os.path.abspath(__file__))
+ trunk_dir = os.path.dirname(buildbot_dir)
+ root_dir = os.path.dirname(trunk_dir)
+ if msvs_version:
+ env = {
+ 'GYP_MSVS_VERSION': msvs_version,
+ }
+ else:
+ env = None
+ retcode = subprocess.call(
+ ['python', 'trunk/gyptest.py',
+ '--all',
+ '--passed',
+ '--format', format,
+ '--chdir', 'trunk',
+ '--path', '../scons'],
+ cwd=root_dir, env=env)
+ if retcode:
+ # Emit failure tag, and keep going.
+ print '@@@STEP_FAILURE@@@'
+ return 1
+
+
+def GypBuild():
+ retcode = 0
+ if sys.platform in ['linux', 'linux2']:
+ retcode += GypTestFormat('scons', format='scons')
+ retcode += GypTestFormat('make', format='make')
+ elif sys.platform == 'darwin':
+ retcode += GypTestFormat('xcode', format='xcode')
+ elif sys.platform == 'win32':
+ retcode += GypTestFormat('msvs-2008', format='msvs', msvs_version='2008')
+ retcode += GypTestFormat('msvs-2010', format='msvs', msvs_version='2010')
+ else:
+ raise Exception('Unknown platform')
+ if retcode:
+ # TODO(bradnelson): once the annotator supports a postscript (section for
+ # after the build proper that could be used for cumulative failures),
+ # use that instead of this. This isolates the final return value so
+ # that it isn't misattributed to the last stage.
+ print '@@@BUILD_STEP failures@@@'
+ sys.exit(retcode)
+
+
+if __name__ == '__main__':
+ GypBuild()