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.
pull/11960/head
Eli Schwartz 1 year ago
parent 9d446d80db
commit 2fd9055810
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 3
      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}')

Loading…
Cancel
Save