Skip to content

Commit

Permalink
merge HEAD changes to put EMBOSS require in BEGIN
Browse files Browse the repository at this point in the history
svn path=/bioperl-run/branches/bioperl-run-branch-1-5-1/; revision=13670
  • Loading branch information
hyphaltip committed Oct 13, 2005
1 parent 3ee0b64 commit c115b57
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions t/EMBOSS.t
Expand Up @@ -7,8 +7,9 @@
# `make test'. After `make install' it should work as `perl test.t' # `make test'. After `make install' it should work as `perl test.t'


use strict; use strict;
use vars qw($error $NTESTS);
BEGIN { BEGIN {
use vars qw($NTESTS); $error = 0;
# to handle systems with no installed Test module # to handle systems with no installed Test module
# we include the t dir (where a copy of Test.pm is located) # we include the t dir (where a copy of Test.pm is located)
# as a fallback # as a fallback
Expand All @@ -18,25 +19,31 @@ BEGIN {
} }
use Test; use Test;
$NTESTS = 30; $NTESTS = 30;
plan tests => $NTESTS } plan tests => $NTESTS;
eval {
require XML::Twig;
require Bio::EMBOSS::Factory;
};
if( $@ ) {
$error = 1;
}
}


use Bio::Factory::EMBOSS;
use Bio::Root::IO; use Bio::Root::IO;
use Bio::SeqIO; use Bio::SeqIO;
use Bio::AlignIO; use Bio::AlignIO;
my $compseqoutfile = 'dna1.4.compseq'; my $compseqoutfile = 'dna1.4.compseq';
my $wateroutfile = 'cysprot.water'; my $wateroutfile = 'cysprot.water';
my $consoutfile = 'cysprot.cons'; my $consoutfile = 'cysprot.cons';
END { END {

foreach ( $Test::ntest..$NTESTS ) { foreach ( $Test::ntest..$NTESTS ) {
skip("EMBOSS not installed locally or XML::Twig not installed",1); skip("EMBOSS not installed locally or XML::Twig not installed",1);
} }
unlink($compseqoutfile); unlink($compseqoutfile);
unlink($wateroutfile); unlink($wateroutfile);
unlink($consoutfile); unlink($consoutfile);
} }

exit(0) if $error;
my $verbose = $ENV{'BIOPERLDEBUG'} || -1; my $verbose = $ENV{'BIOPERLDEBUG'} || -1;
ok(1); ok(1);


Expand All @@ -47,13 +54,15 @@ ok(1);
## total number of tests that will be run. ## total number of tests that will be run.


my $factory = new Bio::Factory::EMBOSS(-verbose => $verbose); my $factory = new Bio::Factory::EMBOSS(-verbose => $verbose);
my $version = $factory->version;
ok($factory); ok($factory);

my $compseqapp = $factory->program('compseq'); my $compseqapp = $factory->program('compseq');
exit if( $compseqapp->executable ) ;

my $version = $factory->version;

if( ! $compseqapp ) { if( ! $compseqapp ) {
# no EMBOSS installed # no EMBOSS installed
exit(); exit(0);
} }


ok($compseqapp); ok($compseqapp);
Expand Down

0 comments on commit c115b57

Please sign in to comment.