perl tap: Show failed command output

Capture stdout and stderr from command_ok() and command_fails() and emit
them as TAP diagnostics on failure.  Output is truncated to the first
and last 30 lines per channel to avoid flooding.

A new helper _diag_command_output() is introduced in Utils.pm so
both functions share the same truncation and formatting logic.

Author: Jelte Fennema-Nio <[email protected]>
Reviewed-by: Andrew Dunstan <[email protected]>
Reviewed-by: Corey Huinker <[email protected]>
Reviewed-by: Zsolt Parragi <[email protected]>
Reviewed-by: Nazir Bilal Yavuz <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1402b8d2fc70faa5154cbc26cab8c4ac384880db

Modified Files
--------------
src/bin/pg_ctl/t/001_start_stop.pl     |  2 +-
src/test/perl/PostgreSQL/Test/Utils.pm | 53 ++++++++++++++++++++++++++++++----
2 files changed, 48 insertions(+), 7 deletions(-)

Reply via email to