couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [02/48] couch commit: updated refs/heads/master to 7776921
Date Sat, 04 Apr 2015 23:28:57 GMT
Return started from test_util:start_applications

COUCHDB-2547


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/9af979fe
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/9af979fe
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/9af979fe

Branch: refs/heads/master
Commit: 9af979fea817d27c53dc7200469889b27ab7cf7d
Parents: b510c21
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Tue Jan 27 08:26:00 2015 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Feb 10 10:31:40 2015 -0800

----------------------------------------------------------------------
 src/test_util.erl | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/9af979fe/src/test_util.erl
----------------------------------------------------------------------
diff --git a/src/test_util.erl b/src/test_util.erl
index 60fa735..07bbeb0 100644
--- a/src/test_util.erl
+++ b/src/test_util.erl
@@ -106,22 +106,23 @@ stop_couch() ->
 stop_couch(_) ->
     stop_couch().
 
-
-start_applications([]) ->
-    ok;
-start_applications([App|Apps]) ->
-    case application:start(App) of
+start_applications(Apps) ->
+    start_applications(Apps, []).
+
+start_applications([], Acc) ->
+    lists:reverse(Acc);
+start_applications([App|Apps], Acc) ->
+    NewAcc =
+        case application:start(App) of
         {error, {already_started, _}} ->
-            ok;
+            start_applications(Apps, Acc);
         {error, {not_started, Dep}} ->
-            start_applications([Dep, App | Apps]);
+            start_applications([Dep, App | Apps], Acc);
         {error, {not_running, Dep}} ->
-            start_applications([Dep, App | Apps]);
+            start_applications([Dep, App | Apps], Acc);
         ok ->
-            ok
-    end,
-    start_applications(Apps).
-
+            start_applications(Apps, [App|Acc])
+    end.
 
 start_config(Chain) ->
     case config:start_link(Chain) of


Mime
View raw message