diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-02-03 17:18:47 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-02-18 02:37:32 +0530 |
commit | dd47bcd2105c7de36520b1477f9f51926b5da58f (patch) | |
tree | 4c11da62d03193648310e6f19cd4223083c1e39f | |
parent | 82057ccd55d7159e15de27237953fd6b754f7750 (diff) | |
download | meson-dd47bcd2105c7de36520b1477f9f51926b5da58f.zip meson-dd47bcd2105c7de36520b1477f9f51926b5da58f.tar.gz meson-dd47bcd2105c7de36520b1477f9f51926b5da58f.tar.bz2 |
run_unittests: Support returning the output of a subprocess
-rwxr-xr-x | run_unittests.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/run_unittests.py b/run_unittests.py index e8d4751..1e9aa5b 100755 --- a/run_unittests.py +++ b/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: |