1 # This is -*-Perl-*- code
2 ## Bioperl Test Harness Script for Modules
6 # Before `make install' is performed this script should be runnable with
7 # `make test'. After `make install' it should work as `perl test.t'
10 use vars qw($NUMTESTS);
16 # to handle systems with no installed Test module
17 # we include the t dir (where a copy of Test.pm is located)
19 eval { require Test; };
26 plan tests => $NUMTESTS;
28 unless (eval "require IO::String; 1;") {
29 print STDERR ("IO::String not installed. Skipping tests $Test::ntest to $NUMTESTS.\n");
30 for ($Test::ntest..$NUMTESTS){
37 my $verbose = $ENV{'BIOPERLDEBUG'};
39 END { unlink('protml.eps'); }
40 ## End of black magic.
42 ## Insert additional test code below but remember to change
43 ## the print "1..x\n" in the BEGIN block to reflect the
44 ## total number of tests that will be run.
46 use Bio::Tools::Phylo::Molphy; # PAML parser
47 use Bio::Tools::Run::Phylo::Molphy::ProtML;
51 for ( $Test::ntest..$NUMTESTS) {
52 skip("Molphy not found. Skipping.",1);
57 my %args = ( 'models' => 'jtt',
59 "other" => [ '-information', '-w']);
60 my $protml = new Bio::Tools::Run::Phylo::Molphy::ProtML(-verbose => $verbose,
62 unless ($protml->executable){
63 warn("Molphy package not installed. Skipping tests $Test::ntest to $NUMTESTS.\n");
67 my $in = new Bio::AlignIO(-format => 'clustalw',
68 -file => Bio::Root::IO->catfile('t','data',
70 my $aln = $in->next_aln;
71 $protml->alignment($aln);
73 my ($rc,$results) = $protml->run();
75 my $r = $results->next_result;
78 while( my $t = $r->next_tree ) {
83 ok($r->search_space,50);
84 ok($trees[0]->score, -453.1);
85 ok($protml->error_string !~ /Error/); # we don't expect any errors;