aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-07-17 13:25:42 -0600
committerSimon Glass <sjg@chromium.org>2018-08-01 16:30:48 -0600
commit2b19321ef9cdc77e00c4d063330e2a4a6818c4fc (patch)
treec9298e538fb616468cf0eebeecbea240cd1b75b7 /tools
parent1d85888cdc1d831ff7a70b95922ee85195e7e09f (diff)
downloadu-boot-2b19321ef9cdc77e00c4d063330e2a4a6818c4fc.zip
u-boot-2b19321ef9cdc77e00c4d063330e2a4a6818c4fc.tar.gz
u-boot-2b19321ef9cdc77e00c4d063330e2a4a6818c4fc.tar.bz2
patman: Allow test commands to fall back to real ones
Tests use the 'test_result' feature to return a predetermined command result for particular commands. The avoids needing to have the real command available just to run a test. It works by calling the function provided by the test, to get the value. However sometimes the test does need to run the real command. Allow it to fall back to do this when the function does not return a result. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/patman/command.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/patman/command.py b/tools/patman/command.py
index 598bfdc..14edcda 100644
--- a/tools/patman/command.py
+++ b/tools/patman/command.py
@@ -61,8 +61,12 @@ def RunPipe(pipe_list, infile=None, outfile=None,
"""
if test_result:
if hasattr(test_result, '__call__'):
- return test_result(pipe_list=pipe_list)
- return test_result
+ result = test_result(pipe_list=pipe_list)
+ if result:
+ return result
+ else:
+ return test_result
+ # No result: fall through to normal processing
result = CommandResult()
last_pipe = None
pipeline = list(pipe_list)