Make Test::Deep tests optional as it's not in the core in contrast to the CGI

This commit is contained in:
Petr Písař 2014-12-10 14:28:41 +01:00
parent b8a3ef630a
commit 0d04b2ade9
2 changed files with 50 additions and 2 deletions

View File

@ -0,0 +1,39 @@
From 307aaf983944b09e62697e1195dee7140852c330 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 10 Dec 2014 14:24:17 +0100
Subject: [PATCH] Make Test::Deep tests optional
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
t/request.t | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/t/request.t b/t/request.t
index f03fe02..3e88226 100644
--- a/t/request.t
+++ b/t/request.t
@@ -4,7 +4,6 @@ use strict;
use warnings;
use Test::More tests => 44;
-use Test::Deep;
use CGI ();
use Config;
@@ -115,7 +114,9 @@ $q->_reset_globals;
is_deeply [ sort $q->$_( 'keywords' ) ], [ qw/ dragon tiger / ],
"$_ keywords" for qw/ param url_param /;
- {
+ SKIP: {
+ skip 'Test::Deep module is not available', 2 unless
+ eval 'use Test::Deep 0.11';
# RT #54511. TODO: use Test::Warn / Test::Warnings / Test::NoWarnings
$^W++;
local $SIG{__WARN__} = sub { fail( "Got a warning: " . $_[0] ); };
--
1.9.3

View File

@ -1,10 +1,12 @@
Name: perl-CGI
Summary: Handle Common Gateway Interface requests and responses
Version: 4.04
Release: 1%{?dist}
Release: 2%{?dist}
License: (GPL+ or Artistic) and Artistic 2.0
Group: Development/Libraries
Source0: http://search.cpan.org/CPAN/authors/id/L/LE/LEEJO/CGI-%{version}.tar.gz
# Make Test::Deep tests optional as it's not in the core in contrast to the CGI
Patch0: CGI-4.04-Make-Test-Deep-tests-optional.patch
URL: http://search.cpan.org/dist/CGI
BuildArch: noarch
BuildRequires: perl
@ -31,9 +33,12 @@ BuildRequires: perl(FileHandle)
BuildRequires: perl(IO::File)
BuildRequires: perl(IO::Handle)
BuildRequires: perl(lib)
BuildRequires: perl(Test::Deep)
BuildRequires: perl(Test::More) >= 0.98
BuildRequires: perl(utf8)
%if !%{defined perl_bootstrap}
# Optional tests
BuildRequires: perl(Test::Deep) >= 0.11
%endif
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
%if 0%(perl -e 'print $] >= 5.019')
Requires: perl(deprecate)
@ -58,6 +63,7 @@ with built-in support for mod_perl and mod_perl2 as well as FastCGI.
%prep
%setup -q -n CGI-%{version}
%patch0 -p1
iconv -f iso8859-1 -t utf-8 < Changes > Changes.1
mv Changes.1 Changes
sed -i 's?usr/bin perl?usr/bin/perl?' t/init.t
@ -80,6 +86,9 @@ make test
%{_mandir}/man3/*.3*
%changelog
* Wed Dec 10 2014 Petr Pisar <ppisar@redhat.com> - 4.04-2
- Make Test::Deep tests optional as it's not in the core in contrast to the CGI
* Fri Sep 19 2014 Jitka Plesnikova <jplesnik@redhat.com> - 4.04-1
- 4.04 bump