r67979 - in /branches/upstream/libredis-perl/current: MANIFEST META.yml Makefile.PL lib/Redis.pm lib/Redis/ lib/Redis/Hash.pm lib/Redis/List.pm scripts/ scripts/redis-benchmark.pl t/00-load.t t/pod-coverage.t
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Fri Jan 28 10:27:14 UTC 2011
Author: eloy
Date: Fri Jan 28 10:27:01 2011
New Revision: 67979
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=67979
Log:
[svn-upgrade] new version libredis-perl (1.2001+git20110127)
Added:
branches/upstream/libredis-perl/current/lib/Redis/
branches/upstream/libredis-perl/current/lib/Redis/Hash.pm
branches/upstream/libredis-perl/current/lib/Redis/List.pm
branches/upstream/libredis-perl/current/scripts/
branches/upstream/libredis-perl/current/scripts/redis-benchmark.pl (with props)
Modified:
branches/upstream/libredis-perl/current/MANIFEST
branches/upstream/libredis-perl/current/META.yml
branches/upstream/libredis-perl/current/Makefile.PL
branches/upstream/libredis-perl/current/lib/Redis.pm
branches/upstream/libredis-perl/current/t/00-load.t
branches/upstream/libredis-perl/current/t/pod-coverage.t
Modified: branches/upstream/libredis-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/MANIFEST?rev=67979&op=diff
==============================================================================
--- branches/upstream/libredis-perl/current/MANIFEST (original)
+++ branches/upstream/libredis-perl/current/MANIFEST Fri Jan 28 10:27:01 2011
@@ -3,6 +3,9 @@
Makefile.PL
README
lib/Redis.pm
+lib/Redis/List.pm
+lib/Redis/Hash.pm
+scripts/redis-benchmark.pl
t/00-load.t
t/pod-coverage.t
t/pod.t
Modified: branches/upstream/libredis-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/META.yml?rev=67979&op=diff
==============================================================================
--- branches/upstream/libredis-perl/current/META.yml (original)
+++ branches/upstream/libredis-perl/current/META.yml Fri Jan 28 10:27:01 2011
@@ -15,7 +15,9 @@
Data::Dumper: 0
Encode: 0
IO::Socket::INET: 0
- Test::More: 0
+ Test::Deep: 0
+ Test::Exception: 0
+ Test::More: 0.92
no_index:
directory:
- t
Modified: branches/upstream/libredis-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/Makefile.PL?rev=67979&op=diff
==============================================================================
--- branches/upstream/libredis-perl/current/Makefile.PL (original)
+++ branches/upstream/libredis-perl/current/Makefile.PL Fri Jan 28 10:27:01 2011
@@ -9,7 +9,9 @@
ABSTRACT_FROM => 'lib/Redis.pm',
PL_FILES => {},
PREREQ_PM => {
- 'Test::More' => 0,
+ 'Test::More' => 0.92,
+ 'Test::Exception' => 0,
+ 'Test::Deep' => 0,
'IO::Socket::INET' => 0,
'Data::Dumper' => 0,
'Carp' => 0,
Modified: branches/upstream/libredis-perl/current/lib/Redis.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/lib/Redis.pm?rev=67979&op=diff
==============================================================================
--- branches/upstream/libredis-perl/current/lib/Redis.pm (original)
+++ branches/upstream/libredis-perl/current/lib/Redis.pm Fri Jan 28 10:27:01 2011
@@ -4,6 +4,8 @@
use strict;
use IO::Socket::INET;
+use IO::Select;
+use Fcntl qw( O_NONBLOCK F_SETFL );
use Data::Dumper;
use Carp qw/confess/;
use Encode;
@@ -42,145 +44,321 @@
=cut
sub new {
- my $class = shift;
- my $self = {@_};
- $self->{debug} ||= $ENV{REDIS_DEBUG};
-
- $self->{sock} = IO::Socket::INET->new(
- PeerAddr => $self->{server} || $ENV{REDIS_SERVER} || '127.0.0.1:6379',
- Proto => 'tcp',
- ) || die $!;
-
- bless($self, $class);
- $self;
-}
-
-my $bulk_command = {
- set => 1, setnx => 1,
- rpush => 1, lpush => 1,
- lset => 1, lrem => 1,
- sadd => 1, srem => 1,
- sismember => 1,
- echo => 1,
- getset => 1,
- smove => 1,
- zadd => 1,
- zrem => 1,
- zscore => 1,
- zincrby => 1,
- append => 1,
-};
-
-# we don't want DESTROY to fallback into AUTOLOAD
-sub DESTROY {}
-
+ my $class = shift;
+ my $self = {@_};
+
+ $self->{debug} ||= $ENV{REDIS_DEBUG};
+ $self->{encoding} ||= 'utf8'; ## default to lax utf8
+
+ $self->{server} ||= $ENV{REDIS_SERVER} || '127.0.0.1:6379';
+ $self->{sock} = IO::Socket::INET->new(
+ PeerAddr => $self->{server},
+ Proto => 'tcp',
+ ) || confess("Could not connect to Redis server at $self->{server}: $!");
+
+ $self->{read_size} = 8192;
+ $self->{rbuf} = '';
+
+ $self->{is_subscriber} = 0;
+ $self->{subscribers} = {};
+
+ return bless($self, $class);
+}
+
+sub is_subscriber { $_[0]{is_subscriber} }
+
+
+### we don't want DESTROY to fallback into AUTOLOAD
+sub DESTROY { }
+
+
+### Deal with common, general case, Redis commands
our $AUTOLOAD;
+
sub AUTOLOAD {
- my $self = shift;
-
- use bytes;
-
- my $sock = $self->{sock} || die "no server connected";
-
- my $command = $AUTOLOAD;
- $command =~ s/.*://;
-
- warn "## $command ",Dumper(@_) if $self->{debug};
-
- my $send;
-
- if ( defined $bulk_command->{$command} ) {
- my $value = pop;
- $value = '' if ! defined $value;
- $send
- = uc($command)
- . ' '
- . join(' ', @_)
- . ' '
- . length( $value )
- . "\r\n$value\r\n"
- ;
- } else {
- $send
- = uc($command)
- . ' '
- . join(' ', @_)
- . "\r\n"
- ;
- }
-
- warn ">> $send" if $self->{debug};
- print $sock $send;
-
- if ( $command eq 'quit' ) {
- close( $sock ) || die "can't close socket: $!";
- return 1;
- }
-
- my $result = <$sock> || die "can't read socket: $!";
- Encode::_utf8_on($result);
- warn "<< $result" if $self->{debug};
- my $type = substr($result,0,1);
- $result = substr($result,1,-2);
-
- if ( $command eq 'info' ) {
- my $hash;
- foreach my $l ( split(/\r\n/, $self->__read_bulk($result) ) ) {
- my ($n,$v) = split(/:/, $l, 2);
- $hash->{$n} = $v;
- }
- return $hash;
- } elsif ( $command eq 'keys' ) {
- my $keys = $self->__read_bulk($result);
- return split(/\s/, $keys) if $keys;
- return;
- }
-
- if ( $type eq '-' ) {
- confess "[$command] $result";
- } elsif ( $type eq '+' ) {
- return $result;
- } elsif ( $type eq '$' ) {
- return $self->__read_bulk($result);
- } elsif ( $type eq '*' ) {
- return $self->__read_multi_bulk($result);
- } elsif ( $type eq ':' ) {
- return $result; # FIXME check if int?
- } else {
- confess "unknown type: $type", $self->__read_line();
- }
-}
-
-sub __read_bulk {
- my ($self,$len) = @_;
- return undef if $len < 0;
-
- my $v;
- if ( $len > 0 ) {
- read($self->{sock}, $v, $len) || die $!;
- Encode::_utf8_on($v);
- warn "<< ",Dumper($v),$/ if $self->{debug};
- }
- my $crlf;
- read($self->{sock}, $crlf, 2); # skip cr/lf
- return $v;
-}
-
-sub __read_multi_bulk {
- my ($self,$size) = @_;
- return undef if $size < 0;
- my $sock = $self->{sock};
-
- $size--;
-
- my @list = ( 0 .. $size );
- foreach ( 0 .. $size ) {
- $list[ $_ ] = $self->__read_bulk( substr(<$sock>,1,-2) );
- }
-
- warn "## list = ", Dumper( @list ) if $self->{debug};
- return @list;
-}
+ my $self = shift;
+ my $sock = $self->{sock} || confess("Not connected to any server");
+ my $enc = $self->{encoding};
+ my $deb = $self->{debug};
+
+ my $command = $AUTOLOAD;
+ $command =~ s/.*://;
+ $self->__is_valid_command($command);
+
+ ## PubSub commands use a different answer handling
+ if (my ($pr, $unsub) = $command =~ /^(p)?(un)?subscribe$/i) {
+ $pr = '' unless $pr;
+
+ my $cb = pop;
+ confess("Missing required callback in call to $command(), ")
+ unless ref($cb) eq 'CODE';
+
+ my @subs = @_;
+ @subs = $self->__process_unsubscribe_requests($cb, $pr, @subs)
+ if $unsub;
+ return unless @subs;
+
+ $self->__send_command($command, @subs);
+
+ my %cbs = map { ("${pr}message:$_" => $cb) } @subs;
+ return $self->__process_subscription_changes($command, \%cbs);
+ }
+
+ $self->__send_command($command, @_);
+ return $self->__read_response($command);
+}
+
+
+### Commands with extra logic
+sub quit {
+ my ($self) = @_;
+
+ $self->__send_command('QUIT');
+
+ delete $self->{rbuf};
+ close(delete $self->{sock}) || confess("Can't close socket: $!");
+
+ return 1;
+}
+
+sub info {
+ my ($self) = @_;
+ $self->__is_valid_command('INFO');
+
+ $self->__send_command('INFO');
+
+ my $info = $self->__read_response('INFO');
+
+ return {map { split(/:/, $_, 2) } split(/\r\n/, $info)};
+}
+
+sub keys {
+ my $self = shift;
+ $self->__is_valid_command('KEYS');
+
+ $self->__send_command('KEYS', @_);
+
+ my @keys = $self->__read_response('KEYS', \my $type);
+ ## Support redis > 1.26
+ return @keys if $type eq '*';
+
+ ## Support redis <= 1.2.6
+ return split(/\s/, $keys[0]) if $keys[0];
+ return;
+}
+
+
+### PubSub
+sub wait_for_messages {
+ my ($self, $timeout) = @_;
+
+ my $s = IO::Select->new;
+ $s->add($self->{sock});
+
+ my $count = 0;
+ while ($s->can_read($timeout)) {
+ while ($self->__can_read_sock) {
+ my @m = $self->__read_response('WAIT_FOR_MESSAGES');
+ $self->__process_pubsub_msg(\@m);
+ $count++;
+ }
+ }
+
+ return $count;
+}
+
+sub __process_unsubscribe_requests {
+ my ($self, $cb, $pr, @unsubs) = @_;
+ my $subs = $self->{subscribers};
+
+ my @subs_to_unsubscribe;
+ for my $sub (@unsubs) {
+ my $key = "${pr}message:$sub";
+ my $cbs = $subs->{$key} = [grep { $_ ne $cb } @{$subs->{$key}}];
+ next if @$cbs;
+
+ delete $subs->{$key};
+ push @subs_to_unsubscribe, $sub;
+ }
+
+ return @subs_to_unsubscribe;
+}
+
+sub __process_subscription_changes {
+ my ($self, $cmd, $expected) = @_;
+ my $subs = $self->{subscribers};
+
+ while (%$expected) {
+ my @m = $self->__read_response($cmd);
+
+ ## Deal with pending PUBLISH'ed messages
+ if ($m[0] =~ /^p?message$/) {
+ $self->__process_pubsub_msg(\@m);
+ next;
+ }
+
+ my ($key, $unsub) = $m[0] =~ m/^(p)?(un)?subscribe$/;
+ $key .= "message:$m[1]";
+ my $cb = delete $expected->{$key};
+
+ push @{$subs->{$key}}, $cb unless $unsub;
+
+ $self->{is_subscriber} = $m[2];
+ }
+}
+
+sub __process_pubsub_msg {
+ my ($self, $m) = @_;
+ my $subs = $self->{subscribers};
+
+ my $sub = $m->[1];
+ my $cbid = "$m->[0]:$sub";
+ my $data = pop @$m;
+ my $topic = $m->[2] || $sub;
+
+ if (!exists $subs->{$cbid}) {
+ warn "Message for topic '$topic' ($cbid) without expected callback, ";
+ return;
+ }
+
+ $_->($data, $topic, $sub) for @{$subs->{$cbid}};
+
+ return 1;
+
+}
+
+
+### Mode validation
+sub __is_valid_command {
+ my ($self, $cmd) = @_;
+
+ return unless $self->{is_subscriber};
+ return if $cmd =~ /^P?(UN)?SUBSCRIBE$/i;
+ confess("Cannot use command '$cmd' while in SUBSCRIBE mode, ");
+}
+
+
+### Socket operations
+sub __send_command {
+ my $self = shift;
+ my $cmd = uc(shift);
+ my $enc = $self->{encoding};
+ my $deb = $self->{debug};
+
+ warn "[SEND] $cmd ", Dumper([@_]) if $deb;
+
+ ## Encode command using multi-bulk format
+ my $n_elems = scalar(@_) + 1;
+ my $buf = "\*$n_elems\r\n";
+ for my $elem ($cmd, @_) {
+ my $bin = $enc ? encode($enc, $elem) : $elem;
+ $buf .= defined($bin) ? '$' . length($bin) . "\r\n$bin\r\n" : "\$-1\r\n";
+ }
+
+ ## Send command, take care for partial writes
+ warn "[SEND RAW] $buf" if $deb;
+ my $sock = $self->{sock} || confess("Not connected to any server");
+ while ($buf) {
+ my $len = syswrite $sock, $buf, length $buf;
+ confess("Could not write to Redis server: $!")
+ unless $len;
+ substr $buf, 0, $len, "";
+ }
+
+ return;
+}
+
+sub __read_response {
+ my ($self, $command, $type_r) = @_;
+
+ my ($type, $result) = $self->__read_sock;
+ $$type_r = $type if $type_r;
+
+ if ($type eq '-') {
+ confess "[$command] $result, ";
+ }
+ elsif ($type eq '+') {
+ return $result;
+ }
+ elsif ($type eq '$') {
+ return if $result < 0;
+ return $self->__read_sock($result);
+ }
+ elsif ($type eq '*') {
+ my @list;
+ while ($result--) {
+ push @list, scalar($self->__read_response($command));
+ }
+ return @list if wantarray;
+ return \@list;
+ }
+ elsif ($type eq ':') {
+ return $result;
+ }
+ else {
+ confess "unknown answer type: $type ($result), ";
+ }
+}
+
+sub __read_sock {
+ my ($self, $len) = @_;
+ my $sock = $self->{sock} || confess("Not connected to any server");
+ my $enc = $self->{encoding};
+ my $deb = $self->{debug};
+ my $rbuf = \($self->{rbuf});
+
+ my ($data, $type) = ('', '');
+ my $read_size = $self->{read_size};
+ $read_size = $len + 2 if defined $len && $len + 2 > $read_size;
+
+ while (1) {
+ ## Read NN bytes, strip \r\n at the end
+ if (defined $len) {
+ if (length($$rbuf) >= $len + 2) {
+ $data = substr(substr($$rbuf, 0, $len + 2, ''), 0, -2);
+ last;
+ }
+ }
+ ## No len, means line more, read until \r\n
+ elsif ($$rbuf =~ s/^(.)([^\015\012]*)\015\012//) {
+ ($type, $data) = ($1, $2);
+ last;
+ }
+
+ my $bytes = sysread $sock, $$rbuf, $read_size, length $$rbuf;
+ confess("Error while reading from Redis server: $!")
+ unless defined $bytes;
+ confess("Redis server closed connection") unless $bytes;
+ }
+
+ $data = decode($enc, $data) if $enc;
+ warn "[RECV] '$type$data'" if $self->{debug};
+
+ return ($type, $data) if $type;
+ return $data;
+}
+
+sub __can_read_sock {
+ my ($self) = @_;
+ my $sock = $self->{sock};
+ my $rbuf = \($self->{rbuf});
+
+ return 1 if $$rbuf;
+ __fh_nonblocking($sock, 1);
+ my $bytes = sysread $sock, $$rbuf, $self->{read_size}, length $$rbuf;
+ __fh_nonblocking($sock, 0);
+ return 1 if $bytes;
+ return 0;
+}
+
+
+### Copied from AnyEvent::Util
+BEGIN {
+ *__fh_nonblocking = ($^O eq 'MSWin32')
+ ? sub($$) { ioctl $_[0], 0x8004667e, pack "L", $_[1]; } # FIONBIO
+ : sub($$) { fcntl $_[0], F_SETFL, $_[1] ? O_NONBLOCK : 0; };
+}
+
1;
Added: branches/upstream/libredis-perl/current/lib/Redis/Hash.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/lib/Redis/Hash.pm?rev=67979&op=file
==============================================================================
--- branches/upstream/libredis-perl/current/lib/Redis/Hash.pm (added)
+++ branches/upstream/libredis-perl/current/lib/Redis/Hash.pm Fri Jan 28 10:27:01 2011
@@ -1,0 +1,71 @@
+package Redis::Hash;
+
+use strict;
+use warnings;
+
+use Tie::Hash;
+use base qw/Redis Tie::StdHash/;
+
+=head1 NAME
+
+Redis::Hash - tie perl hashes into Redis
+
+=head1 SYNOPSYS
+
+ tie %name, 'Redis::Hash', 'prefix';
+
+ my $o = tie %foobar, 'Redis::Hash', 'foobar';
+ print $o->info->{used_memory}; # or any redis command
+
+=cut
+
+# mandatory methods
+sub TIEHASH {
+ my ($class,$name) = @_;
+ my $self = Redis->new;
+ $name .= ':' if $name;
+ $self->{name} = $name || '';
+ bless $self => $class;
+}
+
+sub STORE {
+ my ($self,$key,$value) = @_;
+ $self->set( $self->{name} . $key, $value );
+}
+
+sub FETCH {
+ my ($self,$key) = @_;
+ $self->get( $self->{name} . $key );
+}
+
+sub FIRSTKEY {
+ my $self = shift;
+ $self->{keys} = [ $self->keys( $self->{name} . '*' ) ];
+ $self->NEXTKEY;
+}
+
+sub NEXTKEY {
+ my $self = shift;
+ my $key = shift @{ $self->{keys} } || return;
+ my $name = $self->{name};
+ $key =~ s{^$name}{} || warn "can't strip $name from $key";
+ return $key;
+}
+
+sub EXISTS {
+ my ($self,$key) = @_;
+ $self->exists( $self->{name} . $key );
+}
+
+sub DELETE {
+ my ($self,$key) = @_;
+ $self->del( $self->{name} . $key );
+}
+
+sub CLEAR {
+ my ($self) = @_;
+ $self->del( $_ ) foreach ( $self->keys( $self->{name} . '*' ) );
+ $self->{keys} = [];
+}
+
+1;
Added: branches/upstream/libredis-perl/current/lib/Redis/List.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/lib/Redis/List.pm?rev=67979&op=file
==============================================================================
--- branches/upstream/libredis-perl/current/lib/Redis/List.pm (added)
+++ branches/upstream/libredis-perl/current/lib/Redis/List.pm Fri Jan 28 10:27:01 2011
@@ -1,0 +1,85 @@
+package Redis::List;
+
+use strict;
+use warnings;
+
+use base qw/Redis Tie::Array/;
+
+=head1 NAME
+
+Redis::List - tie perl arrays into Redis lists
+
+=head1 SYNOPSYS
+
+ tie @a, 'Redis::List', 'name';
+
+=cut
+
+# mandatory methods
+sub TIEARRAY {
+ my ($class,$name) = @_;
+ my $self = $class->new;
+ $self->{name} = $name;
+ bless $self => $class;
+}
+
+sub FETCH {
+ my ($self,$index) = @_;
+ $self->lindex( $self->{name}, $index );
+}
+
+sub FETCHSIZE {
+ my ($self) = @_;
+ $self->llen( $self->{name} );
+}
+
+sub STORE {
+ my ($self,$index,$value) = @_;
+ $self->lset( $self->{name}, $index, $value );
+}
+
+sub STORESIZE {
+ my ($self,$count) = @_;
+ $self->ltrim( $self->{name}, 0, $count );
+# if $count > $self->FETCHSIZE;
+}
+
+sub CLEAR {
+ my ($self) = @_;
+ $self->del( $self->{name} );
+}
+
+sub PUSH {
+ my $self = shift;
+ $self->rpush( $self->{name}, $_ ) foreach @_;
+}
+
+sub SHIFT {
+ my $self = shift;
+ $self->lpop( $self->{name} );
+}
+
+sub UNSHIFT {
+ my $self = shift;
+ $self->lpush( $self->{name}, $_ ) foreach @_;
+}
+
+sub SPLICE {
+ my $self = shift;
+ my $offset = shift;
+ my $length = shift;
+ $self->lrange( $self->{name}, $offset, $length );
+ # FIXME rest of @_ ?
+}
+
+sub EXTEND {
+ my ($self,$count) = @_;
+ $self->rpush( $self->{name}, '' ) foreach ( $self->FETCHSIZE .. ( $count - 1 ) );
+}
+
+sub DESTROY {
+ my $self = shift;
+ $self->quit;
+}
+
+1;
Added: branches/upstream/libredis-perl/current/scripts/redis-benchmark.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/scripts/redis-benchmark.pl?rev=67979&op=file
==============================================================================
--- branches/upstream/libredis-perl/current/scripts/redis-benchmark.pl (added)
+++ branches/upstream/libredis-perl/current/scripts/redis-benchmark.pl Fri Jan 28 10:27:01 2011
@@ -1,0 +1,30 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+use Benchmark qw/:all/;
+use lib 'lib';
+use Redis;
+use Redis::Hash;
+
+my $r = Redis->new;
+
+my %hash;
+tie %hash, 'Redis::Hash', 'hash';
+
+my $i = 0;
+
+timethese( 100000, {
+ '00_ping' => sub { $r->ping },
+ '10_set' => sub { $r->set( 'foo', $i++ ) },
+ '11_set_r' => sub { $r->set( 'bench-' . rand(), rand() ) },
+ '20_get' => sub { $r->get( 'foo' ) },
+ '21_get_r' => sub { $r->get( 'bench-' . rand() ) },
+ '30_incr' => sub { $r->incr( 'counter' ) },
+ '30_incr_r' => sub { $r->incr( 'bench-' . rand() ) },
+ '40_lpush' => sub { $r->lpush( 'mylist', 'bar' ) },
+ '40_lpush' => sub { $r->lpush( 'mylist', 'bar' ) },
+ '50_lpop' => sub { $r->lpop( 'mylist' ) },
+ '90_h_set' => sub { $hash{ 'test' . rand() } = rand() },
+ '90_h_get' => sub { my $a = $hash{ 'test' . rand() }; },
+});
Propchange: branches/upstream/libredis-perl/current/scripts/redis-benchmark.pl
------------------------------------------------------------------------------
svn:executable = *
Modified: branches/upstream/libredis-perl/current/t/00-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/t/00-load.t?rev=67979&op=diff
==============================================================================
--- branches/upstream/libredis-perl/current/t/00-load.t (original)
+++ branches/upstream/libredis-perl/current/t/00-load.t Fri Jan 28 10:27:01 2011
@@ -3,7 +3,7 @@
use Test::More tests => 1;
BEGIN {
- use_ok( 'Redis' );
+ use_ok('Redis');
}
-diag( "Testing Redis $Redis::VERSION, Perl $], $^X" );
+diag("Testing Redis $Redis::VERSION, Perl $], $^X");
Modified: branches/upstream/libredis-perl/current/t/pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/t/pod-coverage.t?rev=67979&op=diff
==============================================================================
--- branches/upstream/libredis-perl/current/t/pod-coverage.t (original)
+++ branches/upstream/libredis-perl/current/t/pod-coverage.t Fri Jan 28 10:27:01 2011
@@ -2,17 +2,22 @@
use warnings;
use Test::More;
+plan skip_all =>
+ "Test::Pod::Coverage tests only run if \$RELEASE_TESTING is enabled"
+ unless $ENV{RELEASE_TESTING};
+
# Ensure a recent version of Test::Pod::Coverage
my $min_tpc = 1.08;
eval "use Test::Pod::Coverage $min_tpc";
-plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
- if $@;
+plan skip_all =>
+ "Test::Pod::Coverage $min_tpc required for testing POD coverage"
+ if $@;
# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
# but older versions don't recognize some common documentation styles
my $min_pc = 0.18;
eval "use Pod::Coverage $min_pc";
plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
- if $@;
+ if $@;
all_pod_coverage_ok();
More information about the Pkg-perl-cvs-commits
mailing list