summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-02-24 04:18:09 +0300
committerSimon Glass <sjg@chromium.org>2023-03-08 22:40:49 +0300
commit793aa1761929bc95fe88ef8d0f9747833d185f36 (patch)
tree6a51ad7c15992f74a65cfcba709eedc4a6092575 /tools
parent30eb11ae0483f95f85b483a44387163478bb14d8 (diff)
downloadu-boot-793aa1761929bc95fe88ef8d0f9747833d185f36.tar.xz
buildman: Move the main code into a function
Put this code into a function so it is easy for it be run when packaged. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/buildman/main.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/tools/buildman/main.py b/tools/buildman/main.py
index 6076ba5d63..5e1f68d823 100755
--- a/tools/buildman/main.py
+++ b/tools/buildman/main.py
@@ -46,17 +46,22 @@ def RunTests(skip_net_tests, verboose, args):
return (0 if result.wasSuccessful() else 1)
-options, args = cmdline.ParseArgs()
+def run_buildman():
+ options, args = cmdline.ParseArgs()
-if not options.debug:
- sys.tracebacklimit = 0
+ if not options.debug:
+ sys.tracebacklimit = 0
-# Run our meagre tests
-if options.test:
- RunTests(options.skip_net_tests, options.verbose, args)
+ # Run our meagre tests
+ if cmdline.HAS_TESTS and options.test:
+ RunTests(options.skip_net_tests, options.verbose, args)
-# Build selected commits for selected boards
-else:
- bsettings.Setup(options.config_file)
- ret_code = control.DoBuildman(options, args)
- sys.exit(ret_code)
+ # Build selected commits for selected boards
+ else:
+ bsettings.Setup(options.config_file)
+ ret_code = control.DoBuildman(options, args)
+ sys.exit(ret_code)
+
+
+if __name__ == "__main__":
+ run_buildman()