test/py: Allow RunAndLog() to return the output
authorSimon Glass <sjg@chromium.org>
Sun, 3 Jul 2016 15:40:37 +0000 (09:40 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 14 Jul 2016 22:22:34 +0000 (18:22 -0400)
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>
test/py/multiplexed_log.py

index 68917eb0ea9644d4e922ebcba2a07065a6e8e7bf..02c44df883aedc919e479f7ef347bf6a68d08513 100644 (file)
@@ -119,7 +119,7 @@ class RunAndLog(object):
                 raised if such problems occur.
 
         Returns:
-            Nothing.
+            The output as a string.
         """
 
         msg = '+' + ' '.join(cmd) + '\n'
@@ -161,6 +161,7 @@ class RunAndLog(object):
             self.chained_file.write(output)
         if exception:
             raise exception
+        return output
 
 class SectionCtxMgr(object):
     """A context manager for Python's "with" statement, which allows a certain