[Bioperl-guts-l] bioperl-live/t/lib BioperlTest.pm,1.9,1.10

Senduran Balasubramaniam sendu at dev.open-bio.org
Tue Jun 26 11:43:44 EDT 2007


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

Modified Files:
	BioperlTest.pm 
Log Message:
allowed specification of a minimum version of a required module, improved missing module feedback

Index: BioperlTest.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/lib/BioperlTest.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** BioperlTest.pm	26 Jun 2007 13:50:12 -0000	1.9
--- BioperlTest.pm	26 Jun 2007 15:43:40 -0000	1.10
***************
*** 146,150 ****
  
   Title   : test_begin
!  Usage   : test_begin();
   Function: Begin your test script, setting up the plan (skip all tests, or run
             them all)
--- 146,150 ----
  
   Title   : test_begin
!  Usage   : test_begin(-tests => 20);
   Function: Begin your test script, setting up the plan (skip all tests, or run
             them all)
***************
*** 154,158 ****
             -requires_modules    => []  (array ref of module names that are
                                          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
--- 154,161 ----
             -requires_modules    => []  (array ref of module names that are
                                          required; if any don't load, all tests
!                                         will be skipped. To specify a required
!                                         version of a module, include the version
!                                         number after the module name, separated
!                                         by a space)
             -requires_module     => str (as above, but for just one module)
             -requires_networking => 1|0 (default 0, if true all tests will be
***************
*** 216,220 ****
             -requires_modules    => []  (array ref of module names that are
                                          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
--- 219,226 ----
             -requires_modules    => []  (array ref of module names that are
                                          required; if any don't load, the desired
!                                         number of tests will be skipped. To
!                                         specify a required version of a module,
!                                         include the version number after the
!                                         module name, separated by a space)
             -requires_module     => str (as above, but for just one module)
             -excludes_os         => str (default none, if OS suppied, desired num
***************
*** 357,365 ****
      my $requires = '';
      foreach my $mod (@req_mods) {
!         $requires .= "require $mod; ";
!     }
!     eval $requires;
!     if (!$skip && $@) {
!         $skip = (@req_mods == 1 ? 'The optional module ' : 'One or more of the optional modules ').join(', ', @req_mods).' (or dependencies thereof) not installed';
      }
      
--- 363,389 ----
      my $requires = '';
      foreach my $mod (@req_mods) {
!         my $desired_version;
!         if ($mod =~ /(\S+)\s+(\S+)/) {
!             $mod = $1;
!             $desired_version = $2;
!         }
!         
!         eval "require $mod;";
!         
!         if ($@) {
!             $skip = "The optional module $mod (or dependencies thereof) was not installed" unless $skip;
!             last;
!         }
!         elsif ($desired_version) {
!             no strict 'refs';
!             unless (defined ${"${mod}::VERSION"}) {
!                 $skip = "The optional module $mod didn't have a version, but we want v$desired_version" unless $skip;
!                 last;
!             }
!             elsif (${"${mod}::VERSION"} < $desired_version) {
!                 $skip = "The optional module $mod was out of date (wanted v$desired_version)" unless $skip;
!                 last;
!             }
!         }
      }
      
***************
*** 371,373 ****
  }
  
! 1;
\ No newline at end of file
--- 395,397 ----
  }
  
! 1;



More information about the Bioperl-guts-l mailing list