Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions mesonbuild/mtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ def add_arguments(parser: argparse.ArgumentParser) -> None:
help='Do not redirect stdout and stderr')
parser.add_argument('-q', '--quiet', default=False, action='store_true',
help='Produce less output to the terminal.')
parser.add_argument('--raw-logs', default=False, action='store_true',
help='Show the raw logs for each test')
parser.add_argument('-t', '--timeout-multiplier', type=float, default=None,
help='Define a multiplier for test timeout, for example '
' when running tests in particular conditions they might take'
Expand Down Expand Up @@ -711,6 +713,13 @@ def print_log(self, harness: 'TestHarness', result: 'TestRun') -> None:
print_safe(log)
print(self.output_end)

def print_raw_logs(self, harness: 'TestHarness', result: 'TestRun') -> None:
log = result.get_log(mlog.colorize_console())
if log:
print(self.output_start)
print_safe(log)
print(self.output_end)

def log_subtest(self, harness: 'TestHarness', test: 'TestRun', s: str, result: TestResult, explanation: T.Optional[str]) -> None:
if test.verbose or (harness.options.print_errorlogs and result.is_bad()):
self.flush()
Expand Down Expand Up @@ -741,6 +750,9 @@ def log(self, harness: 'TestHarness', result: 'TestRun') -> None:
flush=True)
if result.verbose or harness.is_bad_result(result):
self.print_log(harness, result)
if harness.options.raw_logs:
self.print_raw_logs(harness, result)

if result.warnings:
print(flush=True)
for w in result.warnings:
Expand Down
Loading