RHEL 9.0.0 Alpha bootstrap

The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/perl-Test-Unit#c818ddca0d68563918c20050f2a901f3bea0d66a
This commit is contained in:
Troy Dawson 2020-10-14 15:21:00 -07:00
parent 41c06ca3b5
commit aac91b233a
7 changed files with 393 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
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

View File

@ -0,0 +1,58 @@
From 9ac12f1967e091b504ac426a70fb41af0d9d44c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Mon, 3 Jun 2019 15:43:31 +0200
Subject: [PATCH] Adapt tests to Perl 5.30
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Perl started to understand a numerical value of hexadecimal strings
like '0xF'. This happens since Perl commit:
commit ce6f496d720f6206455628425320badd95b07372 (HEAD, refs/bisect/bad)
Author: sisyphus <sisyphus1@optusnet.com.au>
Date: Wed Aug 1 22:33:38 2018 +1000
PATCH: [perl #41202] text->float gives wrong answer
This changes to use Perl_strtod() when available, and that turns out to
be the key to fixing this bug.
S_mulexp10() is removed from embed.fnc to avoid repeating the
complicated prerequisites for defining Perl_strtod(). This works
because this static function already was defined before use in
numeric.c, and always called in full form without using a macro.
James Keenan fixed a file permissions problem originally introduced by
this commit, but the fix has been squashed into it.
But it was recognized as a bug and the behavior was restored with:
commit 14d26b44a1d7eee67837ec0ea8fb0368ac6fe33e
Author: Tony Cook <tony@develop-help.com>
Date: Tue Aug 20 15:43:05 2019 +1000
(perl #134230) don't interpret 0x, 0b when numifying strings
Petr Písař: And we ported it to 5.30.0.
---
t/tlib/AssertTest.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/tlib/AssertTest.pm b/t/tlib/AssertTest.pm
index 42fa860..d58890c 100644
--- a/t/tlib/AssertTest.pm
+++ b/t/tlib/AssertTest.pm
@@ -34,7 +34,7 @@ sub test_numericness {
my %tests =
( 1 => 't',
0 => 't',
- '0xF00' => 'f', # controversial? but if you +=10 then it's == 10
+ '0xF00' => ($] gt '5.029001' && $] lt '5.030000') ? 't' : 'f',
'15e7' => 't',
'15E7' => 't',
"not 0" => 'f',
--
2.21.0

212
perl-Test-Unit.spec Normal file
View File

@ -0,0 +1,212 @@
Name: perl-Test-Unit
Version: 0.25
Release: 39%{?dist}
Summary: The PerlUnit testing framework
License: GPL+ or Artistic
URL: http://perlunit.sourceforge.net/
Source0: https://cpan.metacpan.org/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
# Adapt tests to Perl 5.30, bugs #1716422, #1749253, CPAN RT#129738
Patch3: Test-Unit-0.25-Adapt-tests-to-Perl-5.30.patch
BuildArch: noarch
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(base)
BuildRequires: perl(Carp)
BuildRequires: perl(Class::Inner)
BuildRequires: perl(Config)
BuildRequires: perl(constant)
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(Devel::Symdump)
BuildRequires: perl(Error)
BuildRequires: perl(Exporter)
BuildRequires: perl(File::Basename)
BuildRequires: perl(FileHandle)
BuildRequires: perl(lib)
BuildRequires: perl(overload)
BuildRequires: perl(strict)
BuildRequires: perl(Test)
BuildRequires: perl(Tk)
BuildRequires: perl(Tk::Canvas)
BuildRequires: perl(Tk::Derived)
BuildRequires: perl(Tk::DialogBox)
BuildRequires: perl(Tk::ROText)
BuildRequires: perl(vars)
BuildRequires: perl(warnings)
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
%patch3 -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 DESTDIR=$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
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.25-39
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jun 25 2020 Jitka Plesnikova <jplesnik@redhat.com> - 0.25-38
- Perl 5.32 rebuild
* Tue Mar 17 2020 Jitka Plesnikova <jplesnik@redhat.com> - 0.25-37
- Specify all dependencies
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.25-36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Sep 05 2019 Petr Pisar <ppisar@redhat.com> - 0.25-35
- Adapt tests to changed Perl 5.30 (bug #1749253)
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.25-34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Jun 03 2019 Petr Pisar <ppisar@redhat.com> - 0.25-33
- Adapt tests to Perl 5.30 (bug #1716422)
* Fri May 31 2019 Jitka Plesnikova <jplesnik@redhat.com> - 0.25-32
- Perl 5.30 rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.25-31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.25-30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Jun 28 2018 Jitka Plesnikova <jplesnik@redhat.com> - 0.25-29
- Perl 5.28 rebuild
* 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.

12
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 {

1
sources Normal file
View File

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

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