From fe12731a3c7c46a33d436edd88a2fdf758ffe82b Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 17 Nov 2022 19:16:03 +0100 Subject: [PATCH] t/examples: record resulting output for review --- .gitignore | 5 +++++ Makefile | 5 ++++- t/examples.t | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9239659 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# download external resources +/sample/data + +# review test results +/sample/out diff --git a/Makefile b/Makefile index d6f0e7f..2775a1d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,10 @@ barcat: reformat-podusage ./$< $@ test: - prove -f t/regress.t + t/regress.t +tests: + mkdir -p sample/out + prove -f install: barcat $(INSTALL) -d '$(bindir)' diff --git a/t/examples.t b/t/examples.t index cdf77f9..a331ce3 100755 --- a/t/examples.t +++ b/t/examples.t @@ -72,6 +72,13 @@ while (readline $input) { my $output = runres($cmd); ok(!!$output, $name) or diag("command at $ref\n$cmd\n" . ($@ || 'empty output')); + defined $output or next; + + # record output for review + my $numprefix = sprintf '%02d', Test::More->builder->current_test; + if (open my $record, '>', "sample/out/t$numprefix-$name.txt") { + print {$record} $output; + } } sub runres { -- 2.30.0