aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass2023-02-23 18:18:10 -0700
committerSimon Glass2023-03-08 11:40:49 -0800
commit5cfb73b5902d46f656657c765c61e84980d9989c (patch)
tree3b65536e4a02b471221f891353703b2f38234087 /tools
parent793aa1761929bc95fe88ef8d0f9747833d185f36 (diff)
buildman: Hide the test options unless test code is available
It doesn't make much sense to expose tests when buildman is running outside of the U-Boot git checkout. Hide the option in this case Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/buildman/cmdline.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py
index da7f1a99f6b..a9cda249572 100644
--- a/tools/buildman/cmdline.py
+++ b/tools/buildman/cmdline.py
@@ -3,6 +3,11 @@
#
from optparse import OptionParser
+import os
+import pathlib
+
+BUILDMAN_DIR = pathlib.Path(__file__).parent
+HAS_TESTS = os.path.exists(BUILDMAN_DIR / "test.py")
def ParseArgs():
"""Parse command line arguments from sys.argv[]
@@ -105,12 +110,13 @@ def ParseArgs():
default=False, help='Show a build summary')
parser.add_option('-S', '--show-sizes', action='store_true',
default=False, help='Show image size variation in summary')
- parser.add_option('--skip-net-tests', action='store_true', default=False,
- help='Skip tests which need the network')
parser.add_option('--step', type='int',
default=1, help='Only build every n commits (0=just first and last)')
- parser.add_option('-t', '--test', action='store_true', dest='test',
- default=False, help='run tests')
+ if HAS_TESTS:
+ parser.add_option('--skip-net-tests', action='store_true', default=False,
+ help='Skip tests which need the network')
+ parser.add_option('-t', '--test', action='store_true', dest='test',
+ default=False, help='run tests')
parser.add_option('-T', '--threads', type='int',
default=None,
help='Number of builder threads to use (0=single-thread)')