Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding version numbers to tests and test utils to make it easier to k…
…eep them in step w/ any future API changes
  • Loading branch information
sanko committed Sep 17, 2010
1 parent 24ebdec commit fb35269
Show file tree
Hide file tree
Showing 20 changed files with 76 additions and 50 deletions.
1 change: 1 addition & 0 deletions t/10000_by_class/Net/BitTorrent.t
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use Test::More;
use Test::Moose;
use parent 'Test::Class';
Expand Down
1 change: 1 addition & 0 deletions t/10000_by_class/Net/BitTorrent/DHT.t
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::DHT;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use Test::More;
use parent 'Test::Class';
use lib '../../../../lib', 'lib';
Expand Down
1 change: 1 addition & 0 deletions t/10000_by_class/Net/BitTorrent/DHT/Standalone.t
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::DHT::Standalone;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use lib '../', '../../../../../', '../../../../../lib', 'lib';
BEGIN { require 't/10000_by_class/Net/BitTorrent/DHT.t'; }
use parent-norequire, 't::10000_by_class::Net::BitTorrent::DHT';
Expand Down
1 change: 1 addition & 0 deletions t/10000_by_class/Net/BitTorrent/Network/IPFilter.t
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::Network::IPFilter;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use Test::More;
use parent 'Test::Class';
use lib '../../../../../lib', 'lib';
Expand Down
1 change: 1 addition & 0 deletions t/10000_by_class/Net/BitTorrent/Network/IPFilter/Rule.t
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::Network::IPFilter::Rule;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use Test::More;
use parent 'Test::Class';
use lib '../../../../../../lib', 'lib';
Expand Down
1 change: 1 addition & 0 deletions t/10000_by_class/Net/BitTorrent/Network/IPFilter_path.t
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::Network::IPFilter_path;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use Test::More;
use File::Spec;
use lib '../', '../../../../../', '../../../../../lib', 'lib';
Expand Down
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::Protocol::BEP03::Peer::Incoming;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use 5.010.000;
use AnyEvent::Impl::Perl; # Timing is different than with EV. Go figure.
use AnyEvent;
Expand Down
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::Protocol::BEP03::Peer::Outgoing;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use 5.010.000;
use AnyEvent::Impl::Perl; # Timing is different than with EV. Go figure.
use AnyEvent;
Expand Down
105 changes: 55 additions & 50 deletions t/10000_by_class/Net/BitTorrent/Storage/File.t

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions t/10000_by_class/Net/BitTorrent/Torrent/Generator.t
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::Torrent::Generator;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use 5.010.000;
use Test::Most;
use lib '../', '../../../../../', '../../../../../lib', 'lib';
Expand Down
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::Torrent::Generator_announce;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use 5.010.000;
use Test::Most;
use lib '../', '../../../../../', '../../../../../lib', 'lib';
Expand Down
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::Torrent::Generator_announce_list;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use 5.010.000;
use Test::Most;
use lib '../', '../../../../../', '../../../../../lib', 'lib';
Expand Down
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::Torrent::Generator_multiple_files;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use 5.010.000;
use Test::Most;
use lib '../', '../../../../../', '../../../../../lib', 'lib';
Expand Down
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::Torrent::Generator_piece_length;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use 5.010.000;
use Test::Most;
use lib '../', '../../../../../', '../../../../../lib', 'lib';
Expand Down
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent::Torrent::Generator_single_file;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use 5.010.000;
use Test::Most;
use lib '../', '../../../../../', '../../../../../lib', 'lib';
Expand Down
1 change: 1 addition & 0 deletions t/10000_by_class/Net/BitTorrent_random_port.t
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent_random_port;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use lib '../', '../../../', '../../../lib', 'lib';
BEGIN { require 't/10000_by_class/Net/BitTorrent.t'; }
use parent-norequire, 't::10000_by_class::Net::BitTorrent';
Expand Down
1 change: 1 addition & 0 deletions t/10000_by_class/Net/BitTorrent_single_port.t
Expand Up @@ -2,6 +2,7 @@ package t::10000_by_class::Net::BitTorrent_single_port;
{
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use lib '../', '../../../', '../../../lib', 'lib';
BEGIN { require 't/10000_by_class/Net/BitTorrent.t'; }
use parent-norequire, 't::10000_by_class::Net::BitTorrent';
Expand Down
1 change: 1 addition & 0 deletions t/60000_swarm/60010_http.t
@@ -1,5 +1,6 @@
use strict;
use warnings;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);
use lib '../../lib';
use Test::More;
use File::Temp;
Expand Down
2 changes: 2 additions & 0 deletions t/80000_utility/Net/BitTorrent/Tracker.pm
@@ -1,6 +1,8 @@
package Net::BitTorrent::Tracker;
{
use Moose;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);

use AnyEvent::Handle;
use Net::BitTorrent::Network::Utility qw[server];
use Net::BitTorrent::Protocol::BEP03::Bencode qw[:all];
Expand Down
2 changes: 2 additions & 0 deletions t/80000_utility/Net/BitTorrent/Tracker/HTTP.pm
Expand Up @@ -4,6 +4,8 @@ package Net::BitTorrent::Tracker::HTTP;
use Net::BitTorrent::Protocol::BEP07::Compact qw[:all]; # IPv4
use Net::BitTorrent::Protocol::BEP23::Compact qw[:all]; # IPv6
use Moose;
our $MAJOR = 0.074; our $MINOR = 0; our $DEV = 12; our $VERSION = sprintf('%1.3f%03d' . ($DEV ? (($DEV < 0 ? '' : '_') . '%03d') : ('')), $MAJOR, $MINOR, abs $DEV);

extends 'Net::BitTorrent::Tracker';
sub protocol {'tcp'}

Expand Down

0 comments on commit fb35269

Please sign in to comment.