From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v9 07/14] buildman: Set the return code to indicate build result
Date: Mon, 25 Aug 2014 09:58:28 -0600 [thread overview]
Message-ID: <1408982315-18610-8-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1408982315-18610-1-git-send-email-sjg@chromium.org>
When buildman finds errors/warnings when building, set the return code to
indicate this.
Suggested-by: York Sun <yorksun@freescale.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v9:
- Add new patch to set the return code to indicate build result
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
tools/buildman/README | 6 ++++++
tools/buildman/builder.py | 5 +++++
tools/buildman/buildman.py | 3 ++-
tools/buildman/control.py | 9 +++++++--
4 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/tools/buildman/README b/tools/buildman/README
index d4e8404..d20508f 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -690,6 +690,12 @@ Other options
Buildman has various other command line options. Try --help to see them.
+When doing builds, Buildman's return code will reflect the overall result:
+
+ 0 (success) No errors or warnings found
+ 128 Errors found
+ 129 Warnings found
+
How to change from MAKEALL
==========================
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index a555bd8..106fde0 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -1031,6 +1031,10 @@ class Builder:
value is Board object
keep_outputs: True to save build output files
verbose: Display build results as they are completed
+ Returns:
+ Tuple containing:
+ - number of boards that failed to build
+ - number of boards that issued warnings
"""
self.commit_count = len(commits) if commits else 1
self.commits = commits
@@ -1060,3 +1064,4 @@ class Builder:
self.out_queue.join()
print
self.ClearLine(0)
+ return (self.fail, self.warned)
diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py
index e18859b..fbd3125 100755
--- a/tools/buildman/buildman.py
+++ b/tools/buildman/buildman.py
@@ -136,4 +136,5 @@ elif options.full_help:
# Build selected commits for selected boards
else:
- control.DoBuildman(options, args)
+ ret_code = control.DoBuildman(options, args)
+ sys.exit(ret_code)
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index d98e50a..239c423 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -94,7 +94,7 @@ def DoBuildman(options, args):
if options.list_tool_chains:
toolchains.List()
print
- return
+ return 0
# Work out how many commits to build. We want to build everything on the
# branch. We also build the upstream commit as a control so we can see
@@ -219,5 +219,10 @@ def DoBuildman(options, args):
options.show_detail = True
builder.ShowSummary(commits, board_selected)
else:
- builder.BuildBoards(commits, board_selected,
+ fail, warned = builder.BuildBoards(commits, board_selected,
options.keep_outputs, options.verbose)
+ if fail:
+ return 128
+ elif warned:
+ return 129
+ return 0
--
2.1.0.rc2.206.gedb03e5
next prev parent reply other threads:[~2014-08-25 15:58 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-25 15:58 [U-Boot] [PATCH v9 0/14] Add some missing buildman features and deprecate MAKEALL Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 01/14] patman: Support the 'reverse' option for 'git log' Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 02/14] patman: Fix indentation in terminal.py Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 03/14] patman: Correct unit tests to run correctly Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 04/14] patman: Remove the -a option Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 05/14] patman: Use --no-pager' to stop git from forking a pager Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 06/14] patman: Avoid changing the order of tags Simon Glass
2014-08-25 15:58 ` Simon Glass [this message]
2014-08-25 15:58 ` [U-Boot] [PATCH v9 08/14] buildman: Allow make-flags variables to include '-' and '_' Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 09/14] buildman: Implement an option to exclude boards from the build Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 10/14] buildman: Remove the directory prefix from each error line Simon Glass
2014-08-26 14:13 ` Tom Rini
2014-08-27 3:00 ` Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 11/14] buildman: Add an option to show which boards caused which errors Simon Glass
2014-08-25 19:14 ` Tom Rini
2014-08-26 14:09 ` Tom Rini
2014-08-27 2:59 ` Simon Glass
2014-08-28 12:51 ` Tom Rini
2014-09-01 5:09 ` Simon Glass
2014-09-01 11:23 ` Tom Rini
2014-09-02 0:18 ` Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 12/14] buildman: Separate out display of warnings and errors Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 13/14] patman: Fix detection of git version Simon Glass
2014-08-25 15:58 ` [U-Boot] [PATCH v9 14/14] RFC: Deprecate MAKEALL Simon Glass
2014-08-25 18:54 ` [U-Boot] [PATCH v9 0/14] Add some missing buildman features and deprecate MAKEALL Tom Rini
2014-08-25 19:00 ` Simon Glass
2014-08-25 20:21 ` Tom Rini
2014-08-27 2:54 ` Simon Glass
2014-08-28 12:48 ` Tom Rini
2014-09-01 5:07 ` Simon Glass
2014-09-04 18:25 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1408982315-18610-8-git-send-email-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.