~ubuntu-branches/ubuntu/wily/bioperl-run/wily-proposed

« back to all changes in this revision

Viewing changes to t/Consense.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-09-03 11:00:03 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090903110003-11of27rxner5vnl9
Tags: 1.6.1-1
* New upstream release.
* debian/patches/10-wrong-path-for-interpreter.patch: removed
  (fixed upstream).
* debian/watch updated (bioperl -> BioPerl).
* debian/rules refreshed with dh-make-perl 0.53.
  - Disabled installation of examples (removed upstream).
  - Removed the correction of file permission of Pise documentation
    (removed upstream).
  - Removed patching facilities (no patches anymore).
  - Disabled tests as I experience failures with t/Eponine.t despite
    this program is not installed.
* debian/copyright:
  - Removed vanity lines about debianization and debian copyright.
  - Incremented years to 2009.
  - Updated to latest experimentation of the machine-readable license summary.
* debian/control:
  - Incremented Standards-Version to reflect conformance on new Policy
    (dropped versionned build-dependancy on Perl).
  - Removed build-dependancy on quilt (no patches anymore).
  - Depend and Build-Depend on bioperl versions superior or equal to 1.6.0.
  - Build-depends on, and Recommdnes libalgorithm-diff-perl, libipc-run-perl,
    libio-string-perl and libxml-twig-perl, that are listed in DEPENDANCIES.
  - Build-depends on libarray-compare-perl and libtree-dagnode-perl
    (otherwise tests fail). 
  - Depend on amap-align instead of amap (Closes: #541274).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*-Perl-*-
2
2
## Bioperl Test Harness Script for Modules
3
 
## $Id: Consense.t,v 1.5 2006/10/25 09:22:17 sendu Exp $
 
3
## $Id: Consense.t 15337 2009-01-12 00:31:05Z sendu $
4
4
 
5
5
use strict;
6
 
use vars qw($DEBUG);
7
 
$DEBUG = $ENV{'BIOPERLDEBUG'} || -1;
8
6
 
9
7
BEGIN {
10
 
    eval { require Test; };
11
 
    if( $@ ) { 
12
 
        use lib 't';
13
 
    }
14
 
    use Test;
15
 
    use vars qw($NTESTS);
16
 
    $NTESTS = 7;
17
 
    plan tests => $NTESTS;
18
 
    unless (eval "require IO::String; 1;") {
19
 
        print STDERR ("IO::String not installed. Skipping tests $Test::ntest to $NTESTS.\n");
20
 
        for ($Test::ntest..$NTESTS){
21
 
            skip(1,1);
22
 
        }
23
 
        exit(0);
24
 
    }
25
 
}
26
 
 
27
 
use Bio::Tools::Run::Phylo::Phylip::Consense;
28
 
use Bio::AlignIO;
29
 
 
30
 
END {     
31
 
    for ( $Test::ntest..$NTESTS ) {
32
 
        skip("consense not found. Skipping.",1);
33
 
    }
34
 
}
35
 
 
36
 
ok(1);
37
 
my $verbose = $DEBUG;
38
 
my $sb_factory = new Bio::Tools::Run::Phylo::Phylip::Consense
39
 
    (-verbose => $verbose);
40
 
unless($sb_factory->executable){
41
 
    warn("Consense program not found. Skipping tests $Test::ntest to $NTESTS.\n");
42
 
    exit 0;
43
 
}
44
 
 
45
 
ok $sb_factory->isa('Bio::Tools::Run::Phylo::Phylip::Consense');
46
 
 
47
 
$sb_factory->rooted(1);
48
 
 
49
 
ok $sb_factory->rooted, 1, "coludn't set rooted option";
50
 
 
51
 
 
52
 
my $bequiet = $verbose > 0 ? 0 : 1;
53
 
$sb_factory->quiet($bequiet);  # Suppress protpars messages to terminal 
54
 
 
55
 
my $inputfilename = Bio::Root::IO->catfile("t","data","consense.treefile");
56
 
my $tree = $sb_factory->run($inputfilename);
57
 
 
58
 
ok $tree->number_nodes, 13;
59
 
 
60
 
my $node = $tree->find_node('CATH_RAT');
61
 
ok $node->branch_length, "10.0";
62
 
ok $node->id, 'CATH_RAT';
63
 
 
64
 
my @nodes = $tree->get_nodes;
65
 
 
66
 
ok scalar(@nodes),13;
67
 
 
68
 
 
 
8
    use Bio::Root::Test;
 
9
    test_begin(-tests => 9,
 
10
                           -requires_module => 'IO::String');
 
11
        use_ok('Bio::Tools::Run::Phylo::Phylip::Consense');
 
12
        use_ok('Bio::AlignIO');
 
13
}
 
14
 
 
15
my $verbose = test_debug();
 
16
 
 
17
my $sb_factory = Bio::Tools::Run::Phylo::Phylip::Consense->new(-verbose => $verbose);
 
18
 
 
19
SKIP: {
 
20
        test_skip(-requires_executable => $sb_factory,
 
21
             -tests => 7);
 
22
 
 
23
        isa_ok($sb_factory,'Bio::Tools::Run::Phylo::Phylip::Consense');
 
24
        
 
25
        $sb_factory->rooted(1);
 
26
        
 
27
        is $sb_factory->rooted, 1, "coludn't set rooted option";
 
28
 
 
29
        $sb_factory->quiet($verbose);  # Suppress protpars messages to terminal 
 
30
        
 
31
        my $inputfilename = test_input_file("consense.treefile");
 
32
        my $tree = $sb_factory->run($inputfilename);
 
33
        
 
34
        is $tree->number_nodes, 13;
 
35
        
 
36
        my $node = $tree->find_node('CATH_RAT');
 
37
        is $node->branch_length, "10.0";
 
38
        is $node->id, 'CATH_RAT';
 
39
        
 
40
        my @nodes = $tree->get_nodes;
 
41
        
 
42
        is scalar(@nodes),13;
 
43
}