From: Mischa POSLAWSKY Date: Fri, 19 Mar 2021 02:40:22 +0000 (+0100) Subject: capture error messages from examples X-Git-Tag: v1.08~16 X-Git-Url: http://git.shiar.nl/barcat.git/commitdiff_plain/e39bb2aede28e97bc9d8a0477066223388ea324f capture error messages from examples --- diff --git a/t/examples.t b/t/examples.t index 52e7a5a..1af87e5 100755 --- a/t/examples.t +++ b/t/examples.t @@ -52,8 +52,9 @@ while (readline $input) { # run and report unexpected results ok(eval { - run(\@cmd, \undef, \my $output); - $? == 0 or die "error status ", $? >> 8, "\n"; + run(\@cmd, \undef, \my $output, \my $error); + die("error message:\n $error\n") if $error; + $? == 0 or die "exit status ", $? >> 8, "\n"; length $output or die "empty output\n"; return 1; }, $name) or diag("Failed command\n@cmd\nfrom $filename line $.: $@");