[Bioperl-guts-l] [15313] bioperl-run/trunk: Catch version, skip tests if version isn' t supported yet (Clustalw 2.0, fo instance)

Christopher John Fields cjfields at dev.open-bio.org
Wed Jan 7 15:40:53 EST 2009


Revision: 15313
Author:   cjfields
Date:     2009-01-07 15:40:53 -0500 (Wed, 07 Jan 2009)

Log Message:
-----------
Catch version, skip tests if version isn't supported yet (Clustalw 2.0, fo instance)

Modified Paths:
--------------
    bioperl-run/trunk/Bio/Tools/Run/Alignment/Clustalw.pm
    bioperl-run/trunk/t/Clustalw.t

Modified: bioperl-run/trunk/Bio/Tools/Run/Alignment/Clustalw.pm
===================================================================
--- bioperl-run/trunk/Bio/Tools/Run/Alignment/Clustalw.pm	2009-01-07 19:01:33 UTC (rev 15312)
+++ bioperl-run/trunk/Bio/Tools/Run/Alignment/Clustalw.pm	2009-01-07 20:40:53 UTC (rev 15313)
@@ -431,9 +431,8 @@
     return undef unless $self->executable;
     my $prog = $self->executable;
     my $string = `$prog --` ;
-    $string =~ /\(([\d.]+)\)/;
+    $string =~ /\(?([\d.]+)\)?/xms;
     return $1 || undef;
-
 }
 
 =head2  run

Modified: bioperl-run/trunk/t/Clustalw.t
===================================================================
--- bioperl-run/trunk/t/Clustalw.t	2009-01-07 19:01:33 UTC (rev 15312)
+++ bioperl-run/trunk/t/Clustalw.t	2009-01-07 20:40:53 UTC (rev 15313)
@@ -34,8 +34,10 @@
 # setup global objects that are to be used in more than one test
 # Also test they were initialised correctly
 my @params = ('ktuple' => 3, 'quiet'  => 1);
+
 my $factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
 isa_ok( $factory, 'Bio::Tools::Run::Alignment::Clustalw');
+$factory->outfile('test.aln');
 
 # test default factory values
 is( $factory->program_dir, $ENV{'CLUSTALDIR'}, 'program_dir returned correct default' );
@@ -51,8 +53,25 @@
   
   # test all factory methods dependent on finding the executable
   # TODO: isnt( $factory->program_dir, undef,               'Found program in an ENV variable' );
-  ok( $factory->version >= 1.8,                             'Correct minimum program version' );
+  my $ver = $factory->version || 0;
   
+  # remove last bit 
+  $ver =~ s{^(\d+\.\d+)\.\d+}{$1};
+  
+  my $skip;
+  
+  # clustalw2 isn't supported yet.
+  if ($ver < 1.8) {
+    diag("ClustalW version $ver not supported");
+    $skip++;
+  } if ($ver >= 2.0) {
+    diag("ClustalW version $ver not supported yet.");
+    $skip++
+  }
+  skip("ClustalW version $ver not supported yet", 16) if $skip;
+  
+  ok( $ver, "Supported program version $ver" );
+  
   # test execution using filename
   my $aln = $factory->align($inputfilename);
   




More information about the Bioperl-guts-l mailing list