[perl-Test-Unit] apply upstream patch for tests RT#69025 clean spec & new filters

Marcela Mašláňová mmaslano at fedoraproject.org
Thu Jun 23 09:12:54 UTC 2011


commit b5a98e57655e5d39233c158a72eb847398cbc7a5
Author: Marcela Mašláňová <mmaslano at redhat.com>
Date:   Thu Jun 23 11:12:00 2011 +0200

    apply upstream patch for tests RT#69025
    clean spec & new filters

 perl-Test-Unit.spec |   33 ++++++++-------------------------
 tests5.14.patch     |   37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 25 deletions(-)
---
diff --git a/perl-Test-Unit.spec b/perl-Test-Unit.spec
index 5fab532..324e610 100644
--- a/perl-Test-Unit.spec
+++ b/perl-Test-Unit.spec
@@ -7,7 +7,8 @@ Group:          Development/Libraries
 License:        GPL+ or Artistic
 URL:            http://perlunit.sourceforge.net/
 Source0:        http://search.cpan.org/CPAN/authors/id/M/MC/MCAST/Test-Unit-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# https://rt.cpan.org/Public/Bug/Display.html?id=69025
+Patch0:         tests5.14.patch
 
 BuildArch:      noarch
 BuildRequires:  perl(ExtUtils::MakeMaker)
@@ -22,36 +23,22 @@ development paradigm (with support for inheritance of tests etc.) and is
 derived from the JUnit testing framework for Java by Kent Beck and Erich
 Gamma.
 
+%perl_default_filter
+%global __provides_exclude %{?__provides_exclude}|perl\\(Experimental::Sample\\)|perl\\(fail_example\\)|perl\\(fail_example_testsuite_setup\\)
+%global __requires_exclude %{?__requires_exclude}|perl\\(Exporter\\)
 
 %prep
 %setup -q -n Test-Unit-%{version}
+%patch0 -p1
 sed -i 's/\r//' examples/Experimental/Sample.pm
 chmod a+x TkTestRunner.pl TestRunner.pl
 
-cat << EOF > %{name}-prov
-#!/bin/sh
-%{__perl_provides} $* |\
-  sed -e '/perl(Experimental::Sample)/d' -e '/perl(fail_example)/d' -e '/perl(fail_example_testsuite_setup)/d'
-EOF
-%define __perl_provides %{_builddir}/Test-Unit-%{version}/%{name}-prov
-chmod +x %{__perl_provides}
-
-cat << EOF > %{name}-req
-#!/bin/sh
-%{__perl_requires} $* |\
-  sed -e '/perl(Exporter)/d'
-EOF
-%define __perl_requires %{_builddir}/Test-Unit-%{version}/%{name}-req
-chmod +x %{__perl_requires}
-
-
 %build
 %{__perl} Makefile.PL INSTALLDIRS=vendor
 make %{?_smp_mflags}
 
 
 %install
-rm -rf $RPM_BUILD_ROOT
 make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
 find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
 find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null ';'
@@ -62,12 +49,7 @@ chmod -R u+w $RPM_BUILD_ROOT/*
 make test
 
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
 %files
-%defattr(-,root,root,-)
 %doc AUTHORS ChangeLog Changes COPYING.Artistic COPYING.GPL-2 doc examples README
 %{perl_vendorlib}/*
 %{_mandir}/man3/*.3*
@@ -75,7 +57,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %changelog
 * Mon Jun 20 2011 Marcela Mašláňová <mmaslano at redhat.com> - 0.25-11
-- Perl mass rebuild
+- Perl mass rebuild & clean spec & new filters
+- apply upstream patch for tests RT#69025
 
 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.25-10
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
diff --git a/tests5.14.patch b/tests5.14.patch
new file mode 100644
index 0000000..a65ce3c
--- /dev/null
+++ b/tests5.14.patch
@@ -0,0 +1,37 @@
+diff -up Test-Unit-0.25/t/tlib/AssertTest.pm.old Test-Unit-0.25/t/tlib/AssertTest.pm
+--- Test-Unit-0.25/t/tlib/AssertTest.pm.old	2005-10-15 23:19:18.000000000 +0200
++++ Test-Unit-0.25/t/tlib/AssertTest.pm	2011-06-23 10:58:11.187560524 +0200
+@@ -63,6 +63,7 @@ sub test_assert {
+     $self->assert($coderef, 'a', 'a');
+     $self->assert([]);
+     $self->assert([ 'foo', 7 ]);
++    my $re_foo = qr/foo/; $re_foo = "$re_foo";
+     $self->check_failures(
+         'Boolean assertion failed' => [ __LINE__, sub { shift->assert(undef) } ],
+         'Boolean assertion failed' => [ __LINE__, sub { shift->assert(0)   } ],
+@@ -70,7 +71,7 @@ sub test_assert {
+ 
+         'bang'  => [ __LINE__, sub { shift->assert(0, 'bang')              } ],
+         'bang'  => [ __LINE__, sub { shift->assert('', 'bang')             } ],
+-        "'qux' did not match /(?-xism:foo)/"
++        "'qux' did not match /$re_foo/"
+                 => [ __LINE__, sub { shift->assert(qr/foo/, 'qux')         } ],
+         'bang'  => [ __LINE__, sub { shift->assert(qr/foo/, 'qux', 'bang') } ],
+         'a ne b'=> [ __LINE__, sub { shift->assert($coderef, 'a', 'b')     } ],
+@@ -243,6 +244,7 @@ sub test_ok_equals {
+ sub test_ok_not_equals {
+     my $self = shift;
+     my $adder = sub { 2+2 };
++	my $re_x = qr/x/; $re_x = "$re_x";
+     my @checks = (
+         # interface is ok(GOT, EXPECTED);
+         q{expected 1, got 0}                => [ 0,      1       ], 
+@@ -253,7 +255,7 @@ sub test_ok_not_equals {
+         q{expected '', got 'foo'}           => [ 'foo',  ''      ], 
+         q{expected 'foo', got ''}           => [ '',     'foo'   ], 
+         q{expected 5, got 4}                => [ $adder, 5       ], 
+-        q{'foo' did not match /(?-xism:x)/} => [ 'foo',  qr/x/   ], 
++        qq{'foo' did not match /$re_x/}     => [ 'foo',  qr/x/   ],  
+     );
+     my @tests = ();
+     while (@checks) {



More information about the perl-devel mailing list