Skip to content

Commit a1b42e5

Browse files
authored
Merge pull request #17 from szabgab/generate-samples
Allow the easy (re)generation of the sample pdf files
2 parents 48225a6 + bdae84d commit a1b42e5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

t/lib/Tools.pm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ sub compare_pdf {
2727
my $pb_version = version->parse($PDF::Builder::VERSION);
2828
my $file = catfile($dir, 'out.pdf');
2929

30+
# To (re) generate the expected sample files, run:
31+
# GENERATE=1 make test
32+
if ($ENV{GENERATE}) {
33+
mkdir "sample/$pb_version";
34+
open my $out, '>', "sample/$pb_version/$expected_file" or die;
35+
binmode $out;
36+
print $out $content;
37+
close $out;
38+
}
39+
3040
open my $out, '>', $file;
3141
binmode $out;
3242
print $out $content;

0 commit comments

Comments
 (0)