Skip to content
Snippets Groups Projects
Commit 3b8d9d97 authored by Simon Glass's avatar Simon Glass Committed by Tom Rini
Browse files

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: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarTeddy Reed <teddy.reed@gmail.com>
parent 0671960b
Branches
Tags
No related merge requests found
...@@ -119,7 +119,7 @@ class RunAndLog(object): ...@@ -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): ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment