From 18f8a05bd0deaa8b2cc6d7e340dca44c17741acd Mon Sep 17 00:00:00 2001 From: Chris Fields Date: Thu, 7 Jul 2016 10:50:21 -0500 Subject: [PATCH] run only if DB_File and other deps are present (and remove some cruft tests), refers to #172 --- t/LocalDB/Taxonomy/sqlite.t | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/t/LocalDB/Taxonomy/sqlite.t b/t/LocalDB/Taxonomy/sqlite.t index 30d82260d..ca02db210 100644 --- a/t/LocalDB/Taxonomy/sqlite.t +++ b/t/LocalDB/Taxonomy/sqlite.t @@ -7,10 +7,9 @@ BEGIN { use lib '.'; use Bio::Root::Test; - #test_begin( - # - # -requires_modules => [qw(DBI DBD::SQLite )] - #); + test_begin( + -requires_modules => [qw(DB_File DBI DBD::SQLite )] + ); use_ok('Bio::DB::Taxonomy'); use_ok('Bio::Tree::Tree'); @@ -29,39 +28,6 @@ ok my $db_flatfile = Bio::DB::Taxonomy->new( isa_ok $db_flatfile, 'Bio::DB::Taxonomy::sqlite'; isa_ok $db_flatfile, 'Bio::DB::Taxonomy'; -# By not specifying a '-directory' argument, index files go to a temporary -# folder ($Bio::Root::IO::TEMPDIR, such as 'C:\Users\USER\AppData\Local\Temp'), -# and are implied to be temporary. So test the ability of flatfile->DESTROY to -# remove the temporary index files at object destruction (this also affects files -# in "test_output_dir()", since the folder is created inside the temporary folder) -#no warnings qw(once); # silence 'Name "$Bio::Root::IO::TEMPDIR" used only once' -# -#is $db_flatfile->{index_directory}, $Bio::Root::IO::TEMPDIR, 'removal of temporary index files: no -directory'; - -#$db_flatfile->DESTROY; -#ok not -e ($db_flatfile->{index_directory} . '/id2names'); -#ok not -e ($db_flatfile->{index_directory} . '/names2id'); -#ok not -e ($db_flatfile->{index_directory} . '/nodes'); -#ok not -e ($db_flatfile->{index_directory} . '/parents'); - -## Test removal of temporary index files from test_output_dir folder -## (since test_output_dir() =~ m/^$Bio::Root::IO::TEMPDIR/) -#ok $db_flatfile = Bio::DB::Taxonomy->new( -# -source => 'flatfile', -# -directory => $temp_dir, -# -nodesfile => test_input_file('taxdump', 'nodes.dmp'), -# -namesfile => test_input_file('taxdump', 'names.dmp'), -# -force => 1, -#); -#is $db_flatfile->{index_directory}, $temp_dir, 'removal of temporary index files: test_output_dir()'; -#$db_flatfile->DESTROY; -#ok not -e ($db_flatfile->{index_directory} . '/id2names'); -#ok not -e ($db_flatfile->{index_directory} . '/names2id'); -#ok not -e ($db_flatfile->{index_directory} . '/nodes'); -#ok not -e ($db_flatfile->{index_directory} . '/parents'); -# -# Generate the object (and the files) again for the remaining tests - ok my $db = Bio::DB::Taxonomy->new( -source => 'sqlite', -directory => $temp_dir, -- 2.11.4.GIT