From bdae84da75f097e46d07cac8f3890fcdbaa09f77 Mon Sep 17 00:00:00 2001 From: Gabor Szabo Date: Sat, 28 Feb 2026 16:36:15 +0100 Subject: [PATCH] Allow the easy (re)generation of the sample pdf files --- t/lib/Tools.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/lib/Tools.pm b/t/lib/Tools.pm index d358b29..6b39d67 100644 --- a/t/lib/Tools.pm +++ b/t/lib/Tools.pm @@ -27,6 +27,16 @@ sub compare_pdf { my $pb_version = version->parse($PDF::Builder::VERSION); my $file = catfile($dir, 'out.pdf'); + # To (re) generate the expected sample files, run: + # GENERATE=1 make test + if ($ENV{GENERATE}) { + mkdir "sample/$pb_version"; + open my $out, '>', "sample/$pb_version/$expected_file" or die; + binmode $out; + print $out $content; + close $out; + } + open my $out, '>', $file; binmode $out; print $out $content;