run_unittests: Support returning the output of a subprocess

pull/1356/head
Nirbheek Chauhan 8 years ago
parent 82057ccd55
commit dd47bcd210
  1. 9
      run_unittests.py

@ -202,9 +202,12 @@ class BasePlatformTests(unittest.TestCase):
os.environ = self.orig_env
super().tearDown()
def _run(self, command):
self.output += subprocess.check_output(command, stderr=subprocess.STDOUT,
env=os.environ.copy())
def _run(self, command, return_output=False):
output = subprocess.check_output(command, stderr=subprocess.STDOUT,
env=os.environ.copy())
self.output += output
if return_output:
return output
def init(self, srcdir, extra_args=None, default_args=True):
if extra_args is None:

Loading…
Cancel
Save