From e9f77dc072ae3ed7b468f747176ffab0dccfc61f Mon Sep 17 00:00:00 2001 From: Hemmo Nieminen Date: Tue, 1 Feb 2022 00:00:00 +0200 Subject: mtest: differentiate stdout and stderr in test log text files Make --no-stdsplit option affect test log text files as well. This means that if the option --no-stdsplit is used only "output" is seen not only on the console but in the test log text file as well. --- mesonbuild/mtest.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index b5b131667..575dfc255 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -703,8 +703,13 @@ class TextLogfileBuilder(TestFileLogger): if cmdline: starttime_str = time.strftime("%H:%M:%S", time.gmtime(result.starttime)) self.file.write(starttime_str + ' ' + cmdline + '\n') - self.file.write(dashes('output', '-', 78) + '\n') - self.file.write(result.get_log()) + if result.stdo: + name = 'stdout' if harness.options.split else 'output' + self.file.write(dashes(name, '-', 78) + '\n') + self.file.write(result.stdo) + if result.stde: + self.file.write(dashes('stderr', '-', 78) + '\n') + self.file.write(result.stde) self.file.write(dashes('', '-', 78) + '\n\n') async def finish(self, harness: 'TestHarness') -> None: -- cgit v1.2.3