From b9cbad82c76be68014173c7176ff57bbff2e0a0b Mon Sep 17 00:00:00 2001
From: Andrew Yates <ayates@ebi.ac.uk>
Date: Mon, 21 Jan 2013 16:55:02 +0000
Subject: [PATCH] adding tests for registry when not using threads

---
 modules/t/registry.t | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/t/registry.t b/modules/t/registry.t
index 8b3949566a..78184859fe 100644
--- a/modules/t/registry.t
+++ b/modules/t/registry.t
@@ -8,7 +8,7 @@ use Bio::EnsEMBL::Registry;
 use Bio::EnsEMBL::Test::MultiTestDB;
 
 my $threads;
-if($Config{useithreads}) {
+if($Config{useithreads} && ! $ENV{ENS_FORCE_NOTHREADS}) {
   note 'Using threaded tests';
   require threads;
   $threads = 1;
@@ -54,6 +54,8 @@ TMPL
     return \@results;
   };
   
+  my @results;
+  my @expected;
   if($threads) {
     $ENV{RUNTESTS_HARNESS_NORESTORE} = 1;
     my @thrds;
@@ -67,8 +69,10 @@ TMPL
     }
   }
   else {
-    foreach my $itr (0..9) {
-      $call->();
+    foreach my $itr (1..10) {
+      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");
   }
-- 
GitLab