[Bioperl-guts-l] bioperl-run/t Simprot.t,1.1,1.2

Senduran Balasubramaniam sendu at dev.open-bio.org
Thu Jun 14 11:08:33 EDT 2007


Update of /home/repository/bioperl/bioperl-run/t
In directory dev.open-bio.org:/tmp/cvs-serv24018/t

Modified Files:
	Simprot.t 
Log Message:
moved to Test::More, corrected skip; NB: insufficient testing!

Index: Simprot.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-run/t/Simprot.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Simprot.t	16 Jan 2007 16:56:28 -0000	1.1
--- Simprot.t	14 Jun 2007 15:08:31 -0000	1.2
***************
*** 10,84 ****
  use vars qw($NUMTESTS);
  
! my $error;
! 
! BEGIN { 
!     # to handle systems with no installed Test module
!     # we include the t dir (where a copy of Test.pm is located)
!     # as a fallback
!     eval { require Test; };
!     $error = 0;
!     if( $@ ) {
! 	use lib 't';
!     }
!     use Test;
! 
!     $NUMTESTS = 1;
!     plan tests => $NUMTESTS;
! 
!     unless (eval "require IO::String; 1;") {
!         print STDERR "IO::String not installed. Skipping tests $Test::ntest to $NUMTESTS.\n";
!         for ($Test::ntest..$NUMTESTS){
!             skip(1,1);    
!         }
!         exit(0);
!     }
  }
  
! if( $error ==  1 ) {
!     exit(0);
! }
! END { 
!     foreach ( $Test::ntest .. $NUMTESTS ) {
! 	skip("unable to run all of the Simprot tests",1);
      }
  }
- my $testnum;
- my $verbose = 0;
- 
- ## End of black magic.
- ##
- ## Insert additional test code below but remember to change
- ## the print "1..x\n" in the BEGIN block to reflect the
- ## total number of tests that will be run. 
- 
- use Bio::Root::IO;
- use Bio::Tools::Run::Simprot;
- use Bio::AlignIO;
- use Bio::TreeIO;
- 
- my $treeio = Bio::TreeIO->new(
-     -format => 'nhx', -file => 't/data/simprot_tree.nh');
- 
- my $tree = $treeio->next_tree;
- 
- my $simprot = new Bio::Tools::Run::Simprot();
- $simprot->tree($tree);
- $simprot->set_parameter("variablegamma",1);
- $simprot->set_parameter("alpha",0.01);
- $simprot->set_parameter("rootLength",1000);
- $simprot->set_parameter("eFactor",15);
- $simprot->set_parameter("indelFrequncy",0.99);
- $simprot->set_parameter("maxIndel",999999);
- $simprot->set_parameter("Benner",0);
- $simprot->set_parameter("bennerk",-2);
- $simprot->set_parameter("subModel",2);
- $simprot->set_parameter("interleaved",1);
- my @nodes = map { $_->id } $tree->get_leaf_nodes;
- my ($rc,$alnio,$seq) = $simprot->run();
- my $aln = $alnio->next_aln;
- my @seqs = map { $_->display_name} $aln->each_seq;
- ok(scalar(@seqs),scalar(@nodes));
- 
- 
- 
- 1;
--- 10,68 ----
  use vars qw($NUMTESTS);
  
! BEGIN {
!     $NUMTESTS = 6;
! 	
!     eval {require Test::More;};
! 	if ($@) {
! 		use lib 't/lib';
! 	}
! 	use Test::More;
! 	
!     eval {require IO::String };
! 	if ($@) {
! 		plan skip_all => 'IO::String not installed. This means that the module is not usable. Skipping tests';
! 	}
! 	else {
! 		plan tests => $NUMTESTS;
! 	}
! 	
! 	use_ok('Bio::Root::IO');
! 	use_ok('Bio::Tools::Run::Simprot');
! 	use_ok('Bio::AlignIO');
! 	use_ok('Bio::TreeIO');
  }
  
! ok my $simprot = Bio::Tools::Run::Simprot->new();
! 
! SKIP: {
! 	my $present = $simprot->executable();
!     
!     unless ($present) {
!         skip("Simprot program not found. Skipping tests", ($NUMTESTS - 5));
      }
+ 	
+ 	my $treeio = Bio::TreeIO->new(
+ 		-format => 'nhx', -file => 't/data/simprot_tree.nh');
+ 	
+ 	my $tree = $treeio->next_tree;
+ 	
+ 	$simprot->tree($tree);
+ 	$simprot->set_parameter("variablegamma",1);
+ 	$simprot->set_parameter("alpha",0.01);
+ 	$simprot->set_parameter("rootLength",1000);
+ 	$simprot->set_parameter("eFactor",15);
+ 	$simprot->set_parameter("indelFrequncy",0.99);
+ 	$simprot->set_parameter("maxIndel",999999);
+ 	$simprot->set_parameter("Benner",0);
+ 	$simprot->set_parameter("bennerk",-2);
+ 	$simprot->set_parameter("subModel",2);
+ 	$simprot->set_parameter("interleaved",1);
+ 	my @nodes = map { $_->id } $tree->get_leaf_nodes;
+ 	
+ 	my ($rc,$alnio,$seq) = $simprot->run();
+ 	my $aln = $alnio->next_aln;
+ 	my @seqs = map { $_->display_name} $aln->each_seq;
+ 	is (scalar(@seqs),scalar(@nodes));
+ 	
+ 	#*** where are the tests?!
  }



More information about the Bioperl-guts-l mailing list