You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2015/09/23 14:44:43 UTC

couch-log commit: updated refs/heads/master to 7e615ac

Repository: couchdb-couch-log
Updated Branches:
  refs/heads/master 6abf22ab7 -> 7e615ac1b


fix tests for any backend


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

Branch: refs/heads/master
Commit: 7e615ac1b27c61e63b2b8015800ed51ece0f7ad3
Parents: 6abf22a
Author: Robert Newson <rn...@apache.org>
Authored: Wed Sep 23 13:44:35 2015 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Sep 23 13:44:35 2015 +0100

----------------------------------------------------------------------
 src/couch_log.erl | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/blob/7e615ac1/src/couch_log.erl
----------------------------------------------------------------------
diff --git a/src/couch_log.erl b/src/couch_log.erl
index e80685a..669223f 100644
--- a/src/couch_log.erl
+++ b/src/couch_log.erl
@@ -91,7 +91,7 @@ callbacks_test_() ->
         fun setup/0,
         fun cleanup/1,
         [
-            ?_assertEqual({ok, couch_log_stderr}, get_backend()),
+            ?_assertMatch({ok, _}, get_backend()),
             ?_assertEqual(ok, couch_log:debug("message", [])),
             ?_assertEqual(ok, couch_log:info("message", [])),
             ?_assertEqual(ok, couch_log:notice("message", [])),
@@ -107,9 +107,22 @@ callbacks_test_() ->
 setup() ->
     meck:new([couch_stats]),
     meck:expect(couch_stats, increment_counter, fun(_) -> ok end),
-    application:load(?MODULE).
-
-cleanup(_) ->
+    start().
+
+start() ->
+    start([], couch_log).
+
+start(Acc, App) ->
+    case application:start(App) of
+        ok ->
+            [App | Acc];
+        {error, {not_started, Dep}} ->
+            Acc1 = start(Acc, Dep),
+            start(Acc1, App)
+    end.
+
+cleanup(Deps) ->
+    [application:stop(Dep) || Dep <- Deps],
     meck:unload([couch_stats]).
 
 -endif.