From 3c060ef69b71ed04a43f1d746b0355b14620e5fd Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Apr 27 2021 07:31:33 +0000 Subject: Adjust tests to libtiff-4.3.0 --- diff --git a/Graphics-TIFF-10-Adjust-tests-to-changes-in-libtiff-4.3.0.patch b/Graphics-TIFF-10-Adjust-tests-to-changes-in-libtiff-4.3.0.patch new file mode 100644 index 0000000..e0bf422 --- /dev/null +++ b/Graphics-TIFF-10-Adjust-tests-to-changes-in-libtiff-4.3.0.patch @@ -0,0 +1,52 @@ +From e142a8465e3b62a72d0ffdddfc1d2c85f404cadb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 27 Apr 2021 09:18:25 +0200 +Subject: [PATCH] Adjust tests to changes in libtiff 4.3.0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +t/92_tiffinfo.t and t/93_tiff2pdf.t failed with 4.3.0 because tiffinfo +and tiff2pdf changed a usage message. + +This patch adjusts the tests to accept both old and new messages. + +CPAN RT#135330 + +Signed-off-by: Petr Písař +--- + t/92_tiffinfo.t | 2 ++ + t/93_tiff2pdf.t | 4 ++++ + 2 files changed, 6 insertions(+) + +diff --git a/t/92_tiffinfo.t b/t/92_tiffinfo.t +index dd2eb02..be7c45c 100644 +--- a/t/92_tiffinfo.t ++++ b/t/92_tiffinfo.t +@@ -70,6 +70,8 @@ is( `$cmd -z -d $file`, `tiffinfo -z -d $file`, '-z -d' ); + # strip '' from around ?, which newer glibc libraries seem to have added + my $expected = `tiffinfo -? $file 2>&1`; + $expected =~ s/'\?'/?/xsm; ++# strip a description line added in libtiff 4.3.0 ++$expected =~ s/^Display information about TIFF files\R\R//sm; + is( `$cmd -? $file 2>&1`, $expected, '-?' ); + + ######################### +diff --git a/t/93_tiff2pdf.t b/t/93_tiff2pdf.t +index da7284e..3433843 100644 +--- a/t/93_tiff2pdf.t ++++ b/t/93_tiff2pdf.t +@@ -31,6 +31,10 @@ my $expected = `tiff2pdf -? $tif 2>&1`; + $expected =~ s/'\?'/?/xsm; + # strip '-m' option added in tiff-4.2.0 + $expected =~ s/^ -m: .*?\R//ms; ++# strip a description line added in libtiff 4.3.0 ++$expected =~ s/^Convert a TIFF image to a PDF document\R\R//sm; ++# adjust options introduction changed in libtiff 4.3.0 ++$expected =~ s/^where options are:/options:/sm; + is( `$cmd -? $tif 2>&1`, $expected, '-?' ); + + ######################### +-- +2.26.3 + diff --git a/perl-Graphics-TIFF.spec b/perl-Graphics-TIFF.spec index 69e65c0..5878b4d 100644 --- a/perl-Graphics-TIFF.spec +++ b/perl-Graphics-TIFF.spec @@ -3,11 +3,13 @@ Name: perl-Graphics-TIFF Version: 10 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Perl extension for the LibTIFF library License: GPL+ or Artistic URL: https://metacpan.org/release/Graphics-TIFF Source0: https://cpan.metacpan.org/authors/id/R/RA/RATCLIFFE/Graphics-TIFF-%{version}.tar.gz +# Adjust tests to libtiff-4.3.0, CPAN RT#135330, proposed to an upstream +Patch0: Graphics-TIFF-10-Adjust-tests-to-changes-in-libtiff-4.3.0.patch BuildRequires: coreutils BuildRequires: findutils BuildRequires: gcc @@ -81,7 +83,7 @@ Tests from %{name}. Execute them with "%{_libexecdir}/%{name}/test". %prep -%setup -q -n Graphics-TIFF-%{version} +%autosetup -p 1 -n Graphics-TIFF-%{version} # Delete author tests skipped by default for F in t/91_critic.t; do rm "$F" @@ -135,6 +137,9 @@ make test %{_libexecdir}/%{name} %changelog +* Tue Apr 27 2021 Petr Pisar - 10-2 +- Adjust tests to libtiff-4.3.0 (CPAN RT#135330) + * Mon Apr 12 2021 Petr Pisar - 10-1 - 10 version bump