]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
buildman: Set the return code to indicate build result
authorSimon Glass <sjg@chromium.org>
Thu, 28 Aug 2014 15:43:39 +0000 (09:43 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 5 Sep 2014 19:40:42 +0000 (13:40 -0600)
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>
tools/buildman/README
tools/buildman/builder.py
tools/buildman/buildman.py
tools/buildman/control.py

index d4e840480a0922964e1fa90b0069bff984362ef0..d20508f089975237ee54a403d93daa5ea8a07f83 100644 (file)
@@ -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
 ==========================
index a555bd81fc4826dffe410b0fc87996437f4abbd8..106fde0a3215ed2daec471dcf0360f2bbdce5aa3 100644 (file)
@@ -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)
index e18859b3d79723288eb43dd70da6d2acdf081d82..fbd31259bf42478741ffa1f8e1b8ddf08ba12794 100755 (executable)
@@ -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)
index 68ea961876ebde40f7b61bae85a150b7593ca7e7..b8a6cbfe2fc1ede53b4ce3ca13c7cc9fbc5d2c85 100644 (file)
@@ -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
@@ -217,5 +217,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