[Bioperl-guts-l] bioperl-live/t/lib BioperlTest.pm,1.5,1.6

Senduran Balasubramaniam sendu at dev.open-bio.org
Fri Jun 22 05:43:02 EDT 2007


Update of /home/repository/bioperl/bioperl-live/t/lib
In directory dev.open-bio.org:/tmp/cvs-serv2657/t/lib

Modified Files:
	BioperlTest.pm 
Log Message:
added -requires_module option to compliment -requires_modules

Index: BioperlTest.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/lib/BioperlTest.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** BioperlTest.pm	21 Jun 2007 14:50:51 -0000	1.5
--- BioperlTest.pm	22 Jun 2007 09:42:59 -0000	1.6
***************
*** 21,25 ****
    
    test_begin(-tests => 20,
!              -requires_modules => [qw(IO::String)],
               -requires_networking => 1);
  
--- 21,25 ----
    
    test_begin(-tests => 20,
!              -requires_modules => [qw(IO::String XML::Parser)],
               -requires_networking => 1);
  
***************
*** 30,34 ****
    
    SKIP: {
!     test_skip(-tests => 10, -requires_modules => ['Optional::Module']);
      use_ok('Optional::Module');
  
--- 30,34 ----
    
    SKIP: {
!     test_skip(-tests => 10, -requires_module => 'Optional::Module');
      use_ok('Optional::Module');
  
***************
*** 143,146 ****
--- 143,147 ----
                                          required; if any don't load, all tests
                                          will be skipped)
+            -requires_module     => str (as above, but for just one module)
             -requires_networking => 1|0 (default 0, if true all tests will be
                                          skipped if network tests haven't been
***************
*** 197,200 ****
--- 198,202 ----
                                          required; if any don't load, the desired
                                          number of tests will be skipped)
+            -requires_module     => str (as above, but for just one module)
             -excludes_os         => str (default none, if OS suppied, desired num
                                          of tests will skip if running on that OS
***************
*** 254,265 ****
  sub _skip {
      my %args = @_;
      my $tests = $args{'-tests'} || die "-tests must be supplied and positive\n";
      delete $args{'-tests'};
!     my @req_mods = @{$args{'-requires_modules'} || []};
      delete $args{'-requires_modules'};
      my $req_net = $args{'-requires_networking'};
      delete $args{'-requires_networking'};
      my $os = $args{'-excludes_os'};
      delete $args{'-excludes_os'};
      my $framework = $args{'-framework'} || $GLOBAL_FRAMEWORK;
      delete $args{'-framework'};
--- 256,283 ----
  sub _skip {
      my %args = @_;
+     
      my $tests = $args{'-tests'} || die "-tests must be supplied and positive\n";
      delete $args{'-tests'};
!     
!     my $req_mods = $args{'-requires_modules'};
      delete $args{'-requires_modules'};
+     my @req_mods;
+     if ($req_mods) {
+         ref($req_mods) eq 'ARRAY' || die "-requires_modules takes an array ref\n";
+         @req_mods = @{$req_mods};
+     }
+     my $req_mod = $args{'-requires_module'};
+     delete $args{'-requires_module'};
+     if ($req_mod) {
+         ref($req_mod) && die "-requires_module takes a string\n";
+         push(@req_mods, $req_mod);
+     }
+     
      my $req_net = $args{'-requires_networking'};
      delete $args{'-requires_networking'};
+     
      my $os = $args{'-excludes_os'};
      delete $args{'-excludes_os'};
+     
      my $framework = $args{'-framework'} || $GLOBAL_FRAMEWORK;
      delete $args{'-framework'};



More information about the Bioperl-guts-l mailing list