Skip to content

Commit

Permalink
updated unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mtw committed Jun 9, 2017
1 parent 8f2a4d3 commit bad0417
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 100 deletions.
2 changes: 1 addition & 1 deletion Changes
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Revision history for Perl extension Bio::ViennaNGS.
- added scripts/bed2nt2aa.pl
- updated POD and README

0.17 Thu Jun 08 2017
0.17 Fri Jun 09 2017
- added Bio::ViennaNGS::FeatureIO
- added Bio::ViennaNGS::Subtypes
- refactored Bio::ViennaNGS::Fasta to transparently coerce input
Expand Down
4 changes: 3 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ share/template-TrackHub/description.html
share/template-TrackHub/genome.txt
share/template-TrackHub/hub.txt
share/template-TrackHub/trackDb.txt
t/01-basics.t
t/00-prereq.t
t/01-load.t
t/02-thirdparty.t
t/04-UCSC-TrackHub.t
t/05-UCSC-AssemblyHub.t
Expand All @@ -71,3 +72,4 @@ t/07-FeatureIO.t
t/08-FeatureInterval.t
t/09-MinimalFeature.t
t/10-Features.t
t/11-BedGraphEntry.t
4 changes: 3 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ WriteMakefile(
'ExtUtils::MakeMaker' => 0,
},
'BUILD_REQUIRES' => {
'Test::More' => 0,
"Test::More" => 0,
'Test::Prereq' => 0,

},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Bio-ViennaNGS-*' },
Expand Down
93 changes: 0 additions & 93 deletions t/01-basics.t

This file was deleted.

60 changes: 60 additions & 0 deletions t/01-load.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#-*-Perl-*-

use strict;
use warnings;
use Test::More tests => 20;

BEGIN {
use_ok('Bio::ViennaNGS') || print "Bail out! Cannot load Bio::RNA::ViennaNGS\n";
use_ok('Bio::ViennaNGS::AnnoC') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::AnnoC\n";
use_ok('Bio::ViennaNGS::Bam') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::Bam\n";
use_ok('Bio::ViennaNGS::Bed') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::Bed\n";
use_ok('Bio::ViennaNGS::BedGraphEntry') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::BedGraphEntry\n";
use_ok('Bio::ViennaNGS::Expression') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::Expression\n";
use_ok('Bio::ViennaNGS::ExtFeature') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::ExtFeature\n";
use_ok('Bio::ViennaNGS::Fasta') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::Fasta\n";
use_ok('Bio::ViennaNGS::Feature') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::Feature\n";
use_ok('Bio::ViennaNGS::FeatureChain') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::FeatureChain\n";
use_ok('Bio::ViennaNGS::FeatureLine') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::FeatureLine\n";
use_ok('Bio::ViennaNGS::FeatureInterval') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::Featureinterval\n";
use_ok('Bio::ViennaNGS::FeatureIO') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::FeatureIO\n";
use_ok('Bio::ViennaNGS::MinimalFeature') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::MinimalFeature\n";
use_ok('Bio::ViennaNGS::Peak') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::Peak\n";
use_ok('Bio::ViennaNGS::SpliceJunc') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::SpliceJunc\n";
use_ok('Bio::ViennaNGS::Subtypes') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::Subtypes\n";
use_ok('Bio::ViennaNGS::Tutorial') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::tutorial\n";
use_ok('Bio::ViennaNGS::UCSC') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::UCSC\n";
use_ok('Bio::ViennaNGS::Util') || print "Bail out! Cannot load Bio::RNA::ViennaNGS::Util\n";
}


diag( "Test Bio::ViennaNGS $Bio::ViennaNGS::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::AnnoC $Bio::ViennaNGS::AnnoC::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::Bam $Bio::ViennaNGS::Bam::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::Bed $Bio::ViennaNGS::Bed::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::BedGraphEntry $Bio::ViennaNGS::BedGraphEntry::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::Expression $Bio::ViennaNGS::Expression::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::ExtFeature $Bio::ViennaNGS::ExtFeature::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::Fasta $Bio::ViennaNGS::Fasta::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::Feature $Bio::ViennaNGS::Feature::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::FeatureChain $Bio::ViennaNGS::FeatureChain::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::FeatureLine $Bio::ViennaNGS::FeatureLine::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::FeatureInterval $Bio::ViennaNGS::FeatureInterval::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::FeatureIO $Bio::ViennaNGS::FeatureIO::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::MinimalFeature $Bio::ViennaNGS::MinimalFeature::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::Peak $Bio::ViennaNGS::Peak::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::SpliceJunc $Bio::ViennaNGS::SpliceJunc::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::Subtypes $Bio::ViennaNGS::Subtypes::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::Tutorial $Bio::ViennaNGS::Tutorial::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::UCSC $Bio::ViennaNGS::UCSC::VERSION, Perl $], $^X" );
diag( "Test Bio::ViennaNGS::Util $Bio::ViennaNGS::Util::VERSION, Perl $], $^X" );

#ok( defined(can_run('cat')), 'cat not found');
#ok( defined(can_run('awk')), 'awk not found');
#ok( defined(can_run('bedToBigBed')), 'bedToBigBed not found');
#ok( defined(can_run('genomeCoverageBed')), 'genomeCoverageBed not found');
#ok( defined(can_run('bedGraphToBigWig')), 'bedGraphToBigWig not found');
#ok( defined(can_run('faToTwoBit')), 'faToTwoBit not found');
#ok( defined(can_run('bedtools')), 'bedtools not found');
#ok( defined(can_run('sortBed')), 'sortBed not found');
#########################
1 change: 0 additions & 1 deletion t/03-Fasta.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ BEGIN {
use lib 't';
}
use Test::More tests => TEST_COUNT;
print Dumper($Bin);
}

use Bio::ViennaNGS::Fasta;
Expand Down
1 change: 0 additions & 1 deletion t/07-FeatureIO.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ BEGIN {
use lib 't';
}
use Test::More tests => TEST_COUNT;
print Dumper($Bin);
}

use Bio::ViennaNGS::FeatureIO;
Expand Down
1 change: 0 additions & 1 deletion t/08-FeatureInterval.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ BEGIN {
use lib 't';
}
use Test::More tests => TEST_COUNT;
print Dumper($Bin);
}

use Bio::ViennaNGS::FeatureInterval;
Expand Down
1 change: 0 additions & 1 deletion t/09-MinimalFeature.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ BEGIN {
use lib 't';
}
use Test::More tests => TEST_COUNT;
print Dumper($Bin);
}

use Bio::ViennaNGS::MinimalFeature;
Expand Down
33 changes: 33 additions & 0 deletions t/11-BedGraphEntry.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#-*-Perl-*-

use strict;
use warnings;
use Path::Class;
use File::Share ':all';
use Data::Dumper;
use FindBin qw($Bin);
use constant TEST_COUNT => 2;

use lib "$Bin/../lib", "$Bin/../blib/lib", "$Bin/../blib/arch";

BEGIN {
# include Test.pm from 't' dir in case itis not installed
eval { require Test::More; };
if ($@) {
use lib 't';
}
use Test::More tests => TEST_COUNT;
}

use Bio::ViennaNGS::BedGraphEntry;

{
my $chr = "chrX";
my $start = 99999;
my $end = 123456;
my $value = 234433.434354;
my @arg = (chromosome => $chr, start => $start, end => $end, dataValue => $value);
my $BGE = new_ok('Bio::ViennaNGS::BedGraphEntry'=> \@arg);
ok($BGE->_length == 23457, 'length of underlying Featureinterval');
}

0 comments on commit bad0417

Please sign in to comment.