~ubuntu-branches/ubuntu/precise/bioperl/precise

« back to all changes in this revision

Viewing changes to t/XEMBL_DB.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2007-09-21 22:52:22 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070921225222-tt20m2yy6ycuy2d8
Tags: 1.5.2.102-1
* Developer release.
* Upgraded source package to debhelper 5 and standards-version 3.7.2.
* Added libmodule-build-perl and libtest-harness-perl to
  build-depends-indep.
* Disabled automatic CRAN download.
* Using quilt instead of .diff.gz to manage modifications.
* Updated Recommends list for the binary package.
* Moved the "production-quality" scripts to /usr/bin/.
* New maintainer: Debian-Med packaging team mailing list.
* New uploaders: Charles Plessy and Steffen Moeller.
* Updated Depends, Recommends and Suggests.
* Imported in Debian-Med's SVN repository on Alioth.
* Executing the regression tests during package building.
* Moved the Homepage: field out from the package's description.
* Updated watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# This is -*-Perl-*- code
2
2
## Bioperl Test Harness Script for Modules
3
3
##
4
 
# $Id: XEMBL_DB.t,v 1.4 2002/03/15 20:29:22 jason Exp $
 
4
# $Id: XEMBL_DB.t,v 1.5.6.1 2006/10/02 23:10:40 sendu Exp $
5
5
 
6
6
# Before `make install' is performed this script should be runnable with
7
7
# `make test'. After `make install' it should work as `perl test.t'
11
11
my $error;
12
12
 
13
13
BEGIN { 
14
 
    # to handle systems with no installed Test module
15
 
    # we include the t dir (where a copy of Test.pm is located)
16
 
    # as a fallback
17
 
    eval { require Test; };
18
 
    $error = 0;
19
 
    if( $@ ) {
20
 
        use lib 't';
21
 
    }
22
 
    use Test;
23
 
 
24
 
    plan tests => NUMTESTS;
25
 
    
26
 
    unless( eval "require SOAP::Lite; require XML::DOM; 1;" ) {
27
 
 #     warn $@;
 
14
        # to handle systems with no installed Test module
 
15
        # we include the t dir (where a copy of Test.pm is located)
 
16
        # as a fallback
 
17
        eval { require Test; };
 
18
        $error = 0;
 
19
        if( $@ ) {
 
20
                use lib 't';
 
21
        }
 
22
        use Test;
 
23
 
 
24
        plan tests => NUMTESTS;
 
25
 
 
26
        unless( eval "require SOAP::Lite; require XML::DOM; 1;" ) {
28
27
      print STDERR "SOAP::Lite and/or XML::DOM not installed. This means that Bio::DB::XEMBL module is not usable. Skipping tests.\n";
29
28
      for( 1..NUMTESTS ) {
30
 
        skip("SOAP::Lite and/or XML::DOM not installed. This means that Bio::DB::XEMBL module is not usable. Skipping tests.\n",1);
 
29
                        skip("SOAP::Lite and/or XML::DOM not installed. This means that Bio::DB::XEMBL module is not usable. Skipping tests.\n",1);
31
30
      }
32
31
      $error = 1;
33
 
    }
 
32
        }
34
33
}
35
34
 
36
35
if( $error ==  1 ) {
38
37
}
39
38
 
40
39
END {
41
 
    foreach ( $Test::ntest..NUMTESTS) {
42
 
        skip('Server may be down',1);
43
 
    }
 
40
        foreach ( $Test::ntest..NUMTESTS) {
 
41
                skip('Cannot run XEMBL_DB tests',1);
 
42
        }
44
43
}
45
44
 
46
45
require Bio::DB::XEMBL;
58
57
# get a single seq
59
58
 
60
59
$seq = $seqio = undef;
61
 
eval { 
 
60
eval {
62
61
ok defined($db = new Bio::DB::XEMBL(-verbose=>$verbose)); 
63
 
if( ! defined $seq ) {
64
 
    skip('server may be down',1);
65
 
    goto DONE;
66
 
} else {
67
 
    ok(defined($seq = $db->get_Seq_by_acc('J00522')));
68
 
}
 
62
ok(defined($seq = $db->get_Seq_by_acc('J00522')));
69
63
ok( $seq->length, 408);
70
64
ok(defined($seq = $db->get_Seq_by_acc('J02231')));
71
65
ok $seq->id, 'BUM';
76
70
ok( $seq->length, 200);
77
71
};
78
72
if( $@ ) { 
79
 
  DONE:
80
 
    exit; 
 
73
  skip('Skip server may be down',1);
 
74
  exit(0);
81
75
}
82
 
exit;
 
76
 
83
77
$seq = $seqio = undef;
84
78
 
85
79
eval {