Simon Jakobi pushed to branch wip/sjakobi/testsuite-atomic-output at Glasgow Haskell Compiler / GHC
Commits:
9dc76830 by Simon Jakobi at 2026-06-11T08:45:04+02:00
testsuite: Give each test's output block a header
A test's output is now emitted as one contiguous block (see
Note [Atomic test output]), but adjacent blocks had no demarcation,
so e.g. a one-line message from a passing test visually attached
itself to a neighbouring test's failure diff. Prefix each non-empty
block with a header naming the test and follow it with a blank line.
Co-Authored-By: Claude Fable 5
- - - - -
1 changed file:
- testsuite/driver/testlib.py
Changes:
=====================================
testsuite/driver/testlib.py
=====================================
@@ -1590,6 +1590,13 @@ async def runTestAtomically(opts, name: TestName, func, args):
output_buffer_ctx_var.reset(token)
s = buf.getvalue()
if s:
+ # Set the block apart from adjacent tests' output with a header
+ # naming the test and a trailing blank line. Without this,
+ # neighbouring blocks read as one interleaved mess, and output
+ # of passing tests cannot be attributed to its test at all.
+ if not s.endswith('\n'):
+ s += '\n'
+ s = '=====> output from {}:\n{}\n'.format(name, s)
# The event loop is single-threaded and there is no await between
# these calls, so the block is written out atomically.
sys.stdout.write(s)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9dc76830395b1d84f032a54ed0b943eb...
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9dc76830395b1d84f032a54ed0b943eb...
You're receiving this email because of your account on gitlab.haskell.org.