[perl-Perl-Critic] Fix authortest failures
Paul Howarth
pghmcfc at fedoraproject.org
Wed Apr 30 23:12:14 UTC 2014
commit dd1a26eb4a2c40e106e726d65c371487b30ed117
Author: Paul Howarth <paul at city-fan.org>
Date: Wed Apr 30 23:54:57 2014 +0100
Fix authortest failures
- xt/author/82_optional_modules.t shouldn't be trying to use Readonly::XS (#1092921)
- Run the author tests using "Build test" rather than "Build authortest" because the
latter ends up deleting META.yml and that causes the kwalitee test to fail
...tic-1.121-do-not-use-Readonly-XS-directly.patch | 22 ++++++++++++++++++++
perl-Perl-Critic.spec | 17 +++++++++++++-
2 files changed, 37 insertions(+), 2 deletions(-)
---
diff --git a/Perl-Critic-1.121-do-not-use-Readonly-XS-directly.patch b/Perl-Critic-1.121-do-not-use-Readonly-XS-directly.patch
new file mode 100644
index 0000000..b4765d7
--- /dev/null
+++ b/Perl-Critic-1.121-do-not-use-Readonly-XS-directly.patch
@@ -0,0 +1,22 @@
+--- xt/author/82_optional_modules.t
++++ xt/author/82_optional_modules.t
+@@ -11,8 +11,6 @@
+ use strict;
+ use warnings;
+
+-use Readonly; # So we don't barf when we hit Readonly::XS below.
+-
+ use lib 'inc';
+ use Perl::Critic::BuildUtilities qw< recommended_module_versions >;
+
+@@ -37,7 +35,10 @@
+ plan tests => scalar keys %module_versions;
+
+ foreach my $module (sort keys %module_versions) {
++ SKIP: {
++ skip 'Readonly::XS must only be used from Readonly itself', 1 if $module eq 'Readonly::XS';
+ use_ok( $module, $module_versions{$module} );
++ }
+ }
+
+ # Local Variables:
diff --git a/perl-Perl-Critic.spec b/perl-Perl-Critic.spec
index 1ff35f8..2b9de21 100644
--- a/perl-Perl-Critic.spec
+++ b/perl-Perl-Critic.spec
@@ -1,14 +1,16 @@
Name: perl-Perl-Critic
Version: 1.121
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Critique Perl source code for best-practices
Group: Development/Libraries
License: GPL+ or Artistic
URL: http://search.cpan.org/dist/Perl-Critic/
Source0: http://search.cpan.org/CPAN/authors/id/T/TH/THALJEF/Perl-Critic-%{version}.tar.gz
+Patch2: Perl-Critic-1.121-do-not-use-Readonly-XS-directly.patch
BuildArch: noarch
# Build process
+BuildRequires: perl
BuildRequires: perl(lib)
BuildRequires: perl(Module::Build)
BuildRequires: perl(Task::Weaken)
@@ -118,6 +120,9 @@ of Perl code were mixed directly in the test script. That sucked.
%prep
%setup -q -n Perl-Critic-%{version}
+# xt/author/82_optional_modules.t shouldn't be trying to use Readonly::XS (#1092921)
+%patch2
+
# Drop Test::Kwalitee tests in RHEL ≥ 7
%if 0%{?rhel} >= 7
rm xt/author/95_kwalitee.t
@@ -136,7 +141,10 @@ perl Build.PL installdirs=vendor
%{_fixperms} %{buildroot}
%check
-LC_ALL=en_US ./Build %{!?perl_bootstrap:author}test
+./Build test
+%if 0%{!?perl_bootstrap:1}
+LC_ALL=en_US ./Build test --test_files=xt/author/*.t
+%endif
%files
%doc Changes LICENSE README TODO.pod examples/ extras/ tools/
@@ -150,6 +158,11 @@ LC_ALL=en_US ./Build %{!?perl_bootstrap:author}test
%{_mandir}/man3/Test::Perl::Critic::Policy.3pm*
%changelog
+* Wed Apr 30 2014 Paul Howarth <paul at city-fan.org> - 1.121-2
+- xt/author/82_optional_modules.t shouldn't be trying to use Readonly::XS (#1092921)
+- Run the author tests using "Build test" rather than "Build authortest" because the
+ latter ends up deleting META.yml and that causes the kwalitee test to fail
+
* Mon Nov 4 2013 Paul Howarth <paul at city-fan.org> - 1.121-1
- Update to 1.121
- Added new themes based on CERT guidelines
More information about the perl-devel
mailing list