Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 78DEE17D3A for ; Sat, 4 Apr 2015 23:28:57 +0000 (UTC) Received: (qmail 44336 invoked by uid 500); 4 Apr 2015 23:28:56 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 44151 invoked by uid 500); 4 Apr 2015 23:28:56 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 43925 invoked by uid 99); 4 Apr 2015 23:28:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Apr 2015 23:28:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 621BDE2F64; Sat, 4 Apr 2015 23:28:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kxepal@apache.org To: commits@couchdb.apache.org Date: Sat, 04 Apr 2015 23:28:57 -0000 Message-Id: <8d3053cb9f624999924002cdf28e067d@git.apache.org> In-Reply-To: <7e6f3f454a6141008e620dd6cb309fa6@git.apache.org> References: <7e6f3f454a6141008e620dd6cb309fa6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/48] couch commit: updated refs/heads/master to 7776921 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 Authored: Tue Jan 27 08:26:00 2015 -0800 Committer: ILYA Khlopotov 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