Skip to content
Snippets Groups Projects
Commit b9cbad82 authored by Andy Yates's avatar Andy Yates
Browse files

adding tests for registry when not using threads

parent c20f46a6
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ use Bio::EnsEMBL::Registry; ...@@ -8,7 +8,7 @@ use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
my $threads; my $threads;
if($Config{useithreads}) { if($Config{useithreads} && ! $ENV{ENS_FORCE_NOTHREADS}) {
note 'Using threaded tests'; note 'Using threaded tests';
require threads; require threads;
$threads = 1; $threads = 1;
...@@ -54,6 +54,8 @@ TMPL ...@@ -54,6 +54,8 @@ TMPL
return \@results; return \@results;
}; };
my @results;
my @expected;
if($threads) { if($threads) {
$ENV{RUNTESTS_HARNESS_NORESTORE} = 1; $ENV{RUNTESTS_HARNESS_NORESTORE} = 1;
my @thrds; my @thrds;
...@@ -67,8 +69,10 @@ TMPL ...@@ -67,8 +69,10 @@ TMPL
} }
} }
else { else {
foreach my $itr (0..9) { foreach my $itr (1..10) {
$call->(); my $res = $call->();
is_deeply($res, [1, (0)x9], "Testing iteration 1 where we can load an adaptor") if $itr == 1;
is_deeply($res, [(0)x10], "Testing iteration $itr where we can no longer load adaptors") if $itr > 1;
} }
ok("Calling of single-threaded load went off without any problems"); ok("Calling of single-threaded load went off without any problems");
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment