aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-07-10 10:51:52 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-07-10 20:10:02 -0400
commit2fd905581081f8584a4993ad655eddb98a2485c2 (patch)
treeeeb8112a6845052cb578c7e58bce619e03410800
parent9d446d80db5b11b947521cd4e4a21231ddc5154e (diff)
downloadmeson-2fd905581081f8584a4993ad655eddb98a2485c2.zip
meson-2fd905581081f8584a4993ad655eddb98a2485c2.tar.gz
meson-2fd905581081f8584a4993ad655eddb98a2485c2.tar.bz2
mtest: redirect automatic reconfiguring to stderr when listing tests
It is not the primary purpose of mtest, and it ends up mingled with a list of actual tests, which isn't nice if you're trying to capture and parse this.
-rw-r--r--mesonbuild/mtest.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index ed3495a..313e79b 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -1608,7 +1608,8 @@ class TestHarness:
if not self.options.no_rebuild:
teststdo = subprocess.run(self.ninja + ['-n', 'build.ninja'], capture_output=True).stdout
if b'ninja: no work to do.' not in teststdo and b'samu: nothing to do' not in teststdo:
- ret = subprocess.run(self.ninja + ['build.ninja'])
+ stdo = sys.stderr if self.options.list else sys.stdout
+ ret = subprocess.run(self.ninja + ['build.ninja'], stdout=stdo.fileno())
if ret.returncode != 0:
raise TestException(f'Could not configure {self.options.wd!r}')