import perl-Test-Unit-0.25-28.el8

This commit is contained in:
CentOS Sources 2019-05-07 09:06:02 -04:00 committed by Andrew Lukoshko
commit 4a9b811531
6 changed files with 286 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
SOURCES/Test-Unit-0.25.tar.gz

1
.perl-Test-Unit.metadata Normal file
View File

@ -0,0 +1 @@
07f6d020f3e987de573625202b460cc8170c80fa SOURCES/Test-Unit-0.25.tar.gz

View File

@ -0,0 +1,72 @@
From f34895d59eb4e8d5c266a14e0e7ecba4bf6bb35c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Fri, 20 Jun 2014 14:33:02 +0200
Subject: [PATCH] Accept all family differences in the AssertTest test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The t/assert.t's AssertTest test failed randomly depending on order of
hash key traversal:
not ok ERROR test_assert_deep_equals
t/tlib/AssertTest.pm:500 - test_assert_deep_equals(Class::Inner::__A20)
Expected Test::Unit::Failure `(?^mx:^Structures\ begin\ differing\ at: $ \n
\S*\s* \$a .* = .* (?-x:HASH) .* $ \n
\S*\s* \$b .* = .* (?-x:not exist))', got `Structures begin differing at:
$a->{john}{spouse}{spouse}{name} = 'John Doe'
$b->{john}{spouse}{spouse}{name} = 'Baby Doll'
'
This fixes the test to accept the difference in spouse's name.
CPAN RT#87017
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
t/tlib/AssertTest.pm | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/t/tlib/AssertTest.pm b/t/tlib/AssertTest.pm
index 7310874..42fa860 100644
--- a/t/tlib/AssertTest.pm
+++ b/t/tlib/AssertTest.pm
@@ -404,10 +404,22 @@ sub test_assert_deep_equals {
);
my $differ = sub {
- my ($a, $b) = @_;
- qr/^Structures\ begin\ differing\ at: $ \n
- \S*\s* \$a .* = .* (?-x:$a) .* $ \n
- \S*\s* \$b .* = .* (?-x:$b)/mx;
+ my ($a, $b, $c, $d) = @_;
+ if (defined $d) {
+ qr/^Structures\ begin\ differing\ at: $ \n
+ (?:
+ \S*\s* \$a .* = .* (?-x:$a) .* $ \n
+ \S*\s* \$b .* = .* (?-x:$b)
+ |
+ \S*\s* \$a .* = .* (?-x:$c) .* $ \n
+ \S*\s* \$b .* = .* (?-x:$d)
+ )
+ /mx,
+ } else {
+ qr/^Structures\ begin\ differing\ at: $ \n
+ \S*\s* \$a .* = .* (?-x:$a) .* $ \n
+ \S*\s* \$b .* = .* (?-x:$b)/mx;
+ }
};
my %families; # key=test-purpose, value=assorted circular structures
@@ -481,7 +493,7 @@ sub test_assert_deep_equals {
},
}
],
- $differ->( 'HASH', 'not exist') => [$families{orig}, $families{bad_copy}], # test may be fragile due to recursion ordering?
+ $differ->( 'HASH', 'not exist', 'John Doe', 'Baby Doll') => [$families{orig}, $families{bad_copy}], # test may be fragile due to recursion ordering?
$differ->("'3'", "'5'") => [ [ \$H, 3 ], [ \$H2, 5 ] ],
$differ->("'hello'", "'goodbye'") => [ { world => \$H }, { world => \$G } ],
$differ->("'hello'", "'goodbye'") => [ [ \$H, "world" ], [ \$G, "world" ] ],
--
1.9.3

12
SOURCES/perl5.16.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up Test-Unit-0.25/lib/Test/Unit/TestCase.pm.orig Test-Unit-0.25/lib/Test/Unit/TestCase.pm
--- Test-Unit-0.25/lib/Test/Unit/TestCase.pm.orig 2012-06-12 15:38:32.058355073 +0200
+++ Test-Unit-0.25/lib/Test/Unit/TestCase.pm 2012-06-12 15:38:58.340484917 +0200
@@ -103,7 +103,7 @@ sub list_tests {
my $class = ref($_[0]) || $_[0];
my @tests = ();
no strict 'refs';
- if (defined(@{"$class\::TESTS"})) {
+ if (@{"$class\::TESTS"}) {
push @tests, @{"$class\::TESTS"};
}
else {

37
SOURCES/tests5.14.patch Normal file
View File

@ -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) {

163
SPECS/perl-Test-Unit.spec Normal file
View File

@ -0,0 +1,163 @@
Name: perl-Test-Unit
Version: 0.25
Release: 28%{?dist}
Summary: The PerlUnit testing framework
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
# https://rt.cpan.org/Public/Bug/Display.html?id=69025
Patch0: tests5.14.patch
# https://rt.cpan.org/Public/Bug/Display.html?id=77779
Patch1: perl5.16.patch
# Fix random test failures with perl 5.18, bug #1104134, CPAN RT#87017
Patch2: Test-Unit-0.25-Accept-all-family-differences-in-the-AssertTest-test.patch
BuildArch: noarch
BuildRequires: perl-generators
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Carp)
BuildRequires: perl(Class::Inner)
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(Devel::Symdump)
BuildRequires: perl(Error)
BuildRequires: perl(Exporter)
BuildRequires: perl(Test)
BuildRequires: perl(Tk)
BuildRequires: perl(Tk::Canvas)
BuildRequires: perl(Tk::Derived)
BuildRequires: perl(Tk::DialogBox)
BuildRequires: perl(Tk::ROText)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%description
This framework is intended to support unit testing in an object-oriented
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
%patch1 -p1
%patch2 -p1
sed -i 's/\r//' examples/Experimental/Sample.pm
chmod a+x TkTestRunner.pl TestRunner.pl
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}
%install
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 ';'
chmod -R u+w $RPM_BUILD_ROOT/*
%check
make test
%files
%doc AUTHORS ChangeLog Changes COPYING.Artistic COPYING.GPL-2 doc examples README
%{perl_vendorlib}/*
%{_mandir}/man3/*.3*
%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.25-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.25-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sun Jun 04 2017 Jitka Plesnikova <jplesnik@redhat.com> - 0.25-26
- Perl 5.26 rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.25-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Sun May 15 2016 Jitka Plesnikova <jplesnik@redhat.com> - 0.25-24
- Perl 5.24 rebuild
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.25-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Jun 05 2015 Jitka Plesnikova <jplesnik@redhat.com> - 0.25-21
- Perl 5.22 rebuild
* Wed Aug 27 2014 Jitka Plesnikova <jplesnik@redhat.com> - 0.25-20
- Perl 5.20 rebuild
* Fri Jun 20 2014 Petr Pisar <ppisar@redhat.com> - 0.25-19
- Fix random test failures with perl 5.18 (bug #1104134)
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Jul 18 2013 Petr Pisar <ppisar@redhat.com> - 0.25-16
- Perl 5.18 rebuild
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Mon Jun 11 2012 Petr Pisar <ppisar@redhat.com> - 0.25-13
- Perl 5.16 rebuild
- Specify all dependencies
- apply patch to for Test::Unit::TestBase RT#77779
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Mon Jun 20 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.25-11
- Perl mass rebuild & clean spec & new filters
- apply upstream patch for tests RT#69025
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Wed Dec 22 2010 Marcela Maslanova <mmaslano@redhat.com> - 0.25-9
- 661697 rebuild for fixing problems with vendorach/lib
* Fri May 07 2010 Marcela Maslanova <mmaslano@redhat.com> - 0.25-8
- Mass rebuild with perl-5.12.0
* Fri Dec 4 2009 Stepan Kasal <skasal@redhat.com> - 0.25-7
- rebuild against perl 5.10.1
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Thu Mar 06 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.25-4
Rebuild for new perl
* Fri Dec 21 2007 Xavier Bachelot <xavier@bachelot.org> - 0.25-3
- Mangle Summary.
- Fix License.
- Filter unwanted provides.
* Thu Dec 20 2007 Xavier Bachelot <xavier@bachelot.org> - 0.25-2
- Filter unwanted require.
* Tue Dec 11 2007 Xavier Bachelot <xavier@bachelot.org> - 0.25-1
- Initial build.