[Git][ghc/ghc][wip/sjakobi/T16720] 2 commits: testsuite: Style failure output summary header
Simon Jakobi pushed to branch wip/sjakobi/T16720 at Glasgow Haskell Compiler / GHC Commits: a976c52f by Simon Jakobi at 2026-07-18T01:37:59+02:00 testsuite: Style failure output summary header Match the opening of the unexpected failures output summary with its red directional closing marker. Assisted-by: gpt-5 via Codex CLI - - - - - 6c8aef22 by Simon Jakobi at 2026-07-18T01:54:41+02:00 testsuite: Handle unset result source directory Narrow the optional source directory before passing it to relpath, fixing the testsuite-driver mypy job while preserving the empty fallback for early framework failures. Assisted-by: gpt-5 via Codex CLI - - - - - 1 changed file: - testsuite/driver/testlib.py Changes: ===================================== testsuite/driver/testlib.py ===================================== @@ -1500,9 +1500,12 @@ def _newTestDir(name: TestName, opts: TestOptions, tempdir, dir): def _result_directory(opts: TestOptions) -> str: # The test's source directory, relative to the GHC source root, so it reads # the same regardless of which directory `make` was invoked from. + srcdir = opts.srcdir + if srcdir is None: + return '' try: - return os.path.relpath(opts.srcdir, config.top.parent) - except Exception: + return os.path.relpath(srcdir, config.top.parent) + except ValueError: return '' # ----------------------------------------------------------------------------- @@ -3563,7 +3566,6 @@ def summary(t: TestRun, file: TextIO, color=False, junit_path: Optional[Path]=No if t.unexpected_failures: if not too_many_failures: - file.write('Output of unexpected failures:\n\n') printTestOutputSummary(file, t.unexpected_failures, color, junit_path) else: where = '; see {}'.format(junit_path) if junit_path else '' @@ -3657,6 +3659,11 @@ def printTestOutputSummary(file: TextIO, testInfos, color: bool=False, junit_path: Optional[Path]=None) -> None: # Repeat failing tests' captured output in the summary, so one needn't # hunt for it earlier in a possibly very long log; see #16720. + header = '=====> Unexpected failures output summary' + if color: + header = colored(Color.RED, header) + file.write(header + '\n\n') + where = ', see {}'.format(junit_path) if junit_path else '' # Tests that fail identically in several ways (e.g. normal and g1) share one # output block, with the ways collected in the header. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f7d67acb79160bb5575b7697029ef78... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f7d67acb79160bb5575b7697029ef78... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Simon Jakobi (@sjakobi2)