ppisar pushed to perl-Perl-Critic-Dynamic (master). "Adapt tests to changes in CGI-4.14"

notifications at fedoraproject.org notifications at fedoraproject.org
Wed Apr 8 12:48:31 UTC 2015


>From acf7153e1ea2e246b14c8e6e67ca1dad368f5525 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
Date: Wed, 8 Apr 2015 14:44:44 +0200
Subject: Adapt tests to changes in CGI-4.14


diff --git a/Perl-Critic-Dynamic-0.05-test_AUTOLOAD_on_private_module.patch b/Perl-Critic-Dynamic-0.05-test_AUTOLOAD_on_private_module.patch
new file mode 100644
index 0000000..a469e98
--- /dev/null
+++ b/Perl-Critic-Dynamic-0.05-test_AUTOLOAD_on_private_module.patch
@@ -0,0 +1,58 @@
+Test AUTOLOAD on private module
+
+CGI 4.14 stopped to use AUTOLOAD which caused failing tests. This patch
+provides private module with AUTOLOAD instead of relying on CGI.
+
+CPAN RT#103382
+
+Index: t/Dynamic/ValidateAgainstSymbolTable.run
+===================================================================
+--- t/Dynamic/ValidateAgainstSymbolTable.run	(revision 4222)
++++ t/Dynamic/ValidateAgainstSymbolTable.run	(working copy)
+@@ -336,23 +336,24 @@
+ #-----------------------------------------------------------------------------
+ 
+ ## name AUTOLOADers ignored by default
++## parms { at_inc => 'tlib' }
+ ## failures 0
+ ## cut
+ 
+-use CGI;  # Has 'sub AUTOLOAD {...}'
++use TestAutoload;  # Has 'sub AUTOLOAD {...}'
+ 
+-CGI::FooBar();
++TestAutoload::FooBar();
+ 
+ #-----------------------------------------------------------------------------
+ 
+ ## name AUTOLOADers inspected on request
+-## parms { inspect_autoloaders => 1 }
++## parms { at_inc => 'tlib', inspect_autoloaders => 1 }
+ ## failures 1
+ ## cut
+ 
+-use CGI;  # Has 'sub AUTOLOAD {...}'
++use TestAutoload;  # Has 'sub AUTOLOAD {...}'
+ 
+-CGI::FooBar();
++TestAutoload::FooBar();
+ 
+ 
+ #-----------------------------------------------------------------------------
+Index: tlib/TestAutoload.pm
+===================================================================
+--- tlib/TestAutoload.pm	(revision 0)
++++ tlib/TestAutoload.pm	(working copy)
+@@ -0,0 +1,12 @@
++package TestAutoload;
++
++sub AUTOLOAD {
++    print "Autoloading <$AUTOLOAD>\n";
++    goto &foo;
++}   
++
++sub foo {
++    print "foo() called\n";
++}   
++
++1;
diff --git a/perl-Perl-Critic-Dynamic.spec b/perl-Perl-Critic-Dynamic.spec
index c00c356..edab3fb 100644
--- a/perl-Perl-Critic-Dynamic.spec
+++ b/perl-Perl-Critic-Dynamic.spec
@@ -1,12 +1,15 @@
 Name:           perl-Perl-Critic-Dynamic
 Version:        0.05
-Release:        8%{?dist}
+Release:        9%{?dist}
 Summary:        Non-static policies for Perl::Critic
 License:        GPL+ or Artistic
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/Perl-Critic-Dynamic/
 Source0:        http://www.cpan.org/authors/id/T/TH/THALJEF/Perl-Critic-Dynamic-%{version}.tar.gz
+# Adapt to changes in CGI-4.14, bug #1209554, CPAN RT#103382
+Patch0:         Perl-Critic-Dynamic-0.05-test_AUTOLOAD_on_private_module.patch
 BuildArch:      noarch
+BuildRequires:  perl
 BuildRequires:  perl(Module::Build) >= 0.36
 # Run-time:
 BuildRequires:  perl(base)
@@ -21,7 +24,7 @@ BuildRequires:  perl(Storable) >= 2.16
 BuildRequires:  perl(CGI)
 BuildRequires:  perl(Test::More)
 BuildRequires:  perl(Test::Perl::Critic::Policy)
-Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
 Requires:       perl(Devel::Symdump) >= 2.07
 Requires:       perl(Perl::Critic::Policy) >= 1.108
 Requires:       perl(Perl::Critic::Utils) >= 1.108
@@ -43,14 +46,14 @@ a base class for Policies that wish to compile the code they analyze.
 
 %prep
 %setup -q -n Perl-Critic-Dynamic-%{version}
+%patch0 -p0
 
 %build
-%{__perl} Build.PL installdirs=vendor
+perl Build.PL installdirs=vendor
 ./Build
 
 %install
 ./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
-find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
 %{_fixperms} $RPM_BUILD_ROOT/*
 
 %check
@@ -62,6 +65,9 @@ find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
 %{_mandir}/man3/*
 
 %changelog
+* Wed Apr 08 2015 Petr Pisar <ppisar at redhat.com> - 0.05-9
+- Adapt tests to changes in CGI-4.14 (bug #1209554)
+
 * Fri Aug 29 2014 Jitka Plesnikova <jplesnik at redhat.com> - 0.05-8
 - Perl 5.20 rebuild
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/perl-Perl-Critic-Dynamic.git/commit/?h=master&id=acf7153e1ea2e246b14c8e6e67ca1dad368f5525


More information about the scm-commits mailing list