mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-29 16:10:58 +00:00
test/py: Allow RunAndLog() to return the output
Tests may want to look at the output from running a command. Return it so that this is possible. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
This commit is contained in:
parent
0671960bee
commit
3b8d9d977b
1 changed files with 2 additions and 1 deletions
|
@ -119,7 +119,7 @@ class RunAndLog(object):
|
||||||
raised if such problems occur.
|
raised if such problems occur.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Nothing.
|
The output as a string.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
msg = '+' + ' '.join(cmd) + '\n'
|
msg = '+' + ' '.join(cmd) + '\n'
|
||||||
|
@ -161,6 +161,7 @@ class RunAndLog(object):
|
||||||
self.chained_file.write(output)
|
self.chained_file.write(output)
|
||||||
if exception:
|
if exception:
|
||||||
raise exception
|
raise exception
|
||||||
|
return output
|
||||||
|
|
||||||
class SectionCtxMgr(object):
|
class SectionCtxMgr(object):
|
||||||
"""A context manager for Python's "with" statement, which allows a certain
|
"""A context manager for Python's "with" statement, which allows a certain
|
||||||
|
|
Loading…
Reference in a new issue