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
This commit is contained in:
Paul Howarth 2014-04-30 23:54:57 +01:00
parent 5f4aead861
commit dd1a26eb4a
2 changed files with 37 additions and 2 deletions

View File

@ -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:

View File

@ -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@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@city-fan.org> - 1.121-1
- Update to 1.121
- Added new themes based on CERT guidelines