more, better tests for the new implementation for tree/bootstrap -- still some things...
[bioperl-run.git] / t / DrawTree.t
blob23a83d4d948deec543323e106a4983019a229fa1
1 # -*-Perl-*-
2 ## Bioperl Test Harness Script for Modules
3 ## $Id$
5 use strict;
6 use vars qw($DEBUG);
8 $DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
9 BEGIN {
10     eval { require Test; };
11     if( $@ ) { 
12         use lib 't';
13     }
14     use Test;
15     use vars qw($NTESTS);
16     $NTESTS = 4;
17     plan tests => $NTESTS;
20 use Bio::Tools::Run::Phylo::Phylip::DrawTree;
21 use Bio::TreeIO;
23 END {     
24     for ( $Test::ntest..$NTESTS ) {
25         skip("drawtree not found. Skipping.",1);
26     }
29 my @params = ('-verbose' => 0,
30               'quiet'    => 1);
31 my $treedraw = Bio::Tools::Run::Phylo::Phylip::DrawTree->new(@params);
32 unless($treedraw->executable){
33     warn("drawgram program not found. Skipping tests $Test::ntest to $NTESTS.\n");
34     exit 0;
37 $treedraw->fontfile(Bio::Root::IO->catfile(qw(t data fontfile)));
38 my $file = $treedraw->draw_tree(Bio::Root::IO->catfile(qw(t data treefile.example)));
39 ok($file);
40 ok(-e $file);
42 if( $DEBUG ) {
43     `gv $file`;
44 } else { 
45     unlink($file);
48 my $intree = new Bio::TreeIO(-file => Bio::Root::IO->catfile(qw(t data treefile.example)));
50 $file = $treedraw->draw_tree(Bio::Root::IO->catfile(qw(t data 
51                                                        treefile.example)));
52 ok($file);
53 ok(-e $file);
55 if( $DEBUG ) {
56     `gv $file`;
57 } else { 
58     unlink($file);