couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bitdid...@apache.org
Subject git commit: Update etap and remove obsolete files
Date Thu, 26 Apr 2012 18:24:25 GMT
Updated Branches:
  refs/heads/master c2b12491a -> eb3d5d8b4


Update etap and remove obsolete files

Update tests to use new etap, removed unused variable warnings, and
added a check-etap to the Makefile as a convenience


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

Branch: refs/heads/master
Commit: eb3d5d8b4e973b8766a17055b1cf7258a6b8df89
Parents: c2b1249
Author: bitdiddle <bitdiddle@apache.org>
Authored: Thu Apr 26 12:28:53 2012 -0400
Committer: Bob Dionne <bob@cloudant.com>
Committed: Thu Apr 26 14:15:09 2012 -0400

----------------------------------------------------------------------
 Makefile.am                         |    3 +
 src/couch_mrview/test/01-load.t     |    2 +-
 src/couch_replicator/test/01-load.t |    2 +-
 src/etap/Makefile.am                |   20 +--
 src/etap/etap.erl                   |  330 +++++++++++++++++++++++------
 src/etap/etap_application.erl       |   72 -------
 src/etap/etap_can.erl               |   79 -------
 src/etap/etap_exception.erl         |   66 ------
 src/etap/etap_process.erl           |   42 ----
 src/etap/etap_report.erl            |  343 ------------------------------
 src/etap/etap_request.erl           |   89 --------
 src/etap/etap_string.erl            |   47 ----
 src/etap/etap_web.erl               |   65 ------
 test/etap/001-load.t                |    2 +-
 test/etap/020-btree-basics.t        |    4 +-
 test/etap/040-util.t                |    4 +-
 test/etap/050-stream.t              |    2 +-
 test/etap/072-cleanup.t             |    2 +-
 test/etap/073-changes.t             |    2 +-
 test/etap/083-config-no-files.t     |    2 -
 test/etap/090-task-status.t         |    3 -
 21 files changed, 278 insertions(+), 903 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index 02b4bd1..9dd22b8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -89,6 +89,9 @@ if USE_CURL
 	$(top_builddir)/test/javascript/run
 endif
 
+check-etap: dev
+	$(top_builddir)/test/etap/run $(top_srcdir)/test/etap
+
 cover: dev
 	rm -f cover/*.coverdata
 	COVER=1 COVER_BIN=./src/couchdb/ $(top_builddir)/test/etap/run

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/couch_mrview/test/01-load.t
----------------------------------------------------------------------
diff --git a/src/couch_mrview/test/01-load.t b/src/couch_mrview/test/01-load.t
index 4613f49..a57c1a7 100644
--- a/src/couch_mrview/test/01-load.t
+++ b/src/couch_mrview/test/01-load.t
@@ -29,6 +29,6 @@ main(_) ->
     etap:plan(length(Modules)),
     lists:foreach(
         fun(Module) ->
-            etap_can:loaded_ok(Module, lists:concat(["Loaded: ", Module]))
+            etap:loaded_ok(Module, lists:concat(["Loaded: ", Module]))
         end, Modules),
     etap:end_tests().

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/couch_replicator/test/01-load.t
----------------------------------------------------------------------
diff --git a/src/couch_replicator/test/01-load.t b/src/couch_replicator/test/01-load.t
index 07561a7..8bd82dd 100644
--- a/src/couch_replicator/test/01-load.t
+++ b/src/couch_replicator/test/01-load.t
@@ -32,6 +32,6 @@ main(_) ->
     etap:plan(length(Modules)),
     lists:foreach(
         fun(Module) ->
-            etap_can:loaded_ok(Module, lists:concat(["Loaded: ", Module]))
+            etap:loaded_ok(Module, lists:concat(["Loaded: ", Module]))
         end, Modules),
     etap:end_tests().

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/etap/Makefile.am
----------------------------------------------------------------------
diff --git a/src/etap/Makefile.am b/src/etap/Makefile.am
index 732347b..beaf65c 100644
--- a/src/etap/Makefile.am
+++ b/src/etap/Makefile.am
@@ -13,26 +13,10 @@
 etapebindir = $(localerlanglibdir)/etap/ebin
 
 etap_file_collection = \
-    etap.erl \
-   	etap_application.erl \
-    etap_can.erl \
-    etap_exception.erl \
-    etap_process.erl \
-	etap_report.erl \
-	etap_request.erl \
-	etap_string.erl \
-   	etap_web.erl
+    etap.erl
 
 etapebin_make_generated_file_list = \
-    etap.beam \
-   	etap_application.beam \
-    etap_can.beam \
-    etap_exception.beam \
-    etap_process.beam \
-	etap_report.beam \
-	etap_request.beam \
-	etap_string.beam \
-   	etap_web.beam
+    etap.beam
 
 etapebin_DATA = $(etapebin_make_generated_file_list)
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/etap/etap.erl
----------------------------------------------------------------------
diff --git a/src/etap/etap.erl b/src/etap/etap.erl
index c76b980..7380013 100644
--- a/src/etap/etap.erl
+++ b/src/etap/etap.erl
@@ -44,22 +44,66 @@
 %% a number of etap tests and then calling eta:end_tests/0. Please refer to
 %% the Erlang modules in the t directory of this project for example tests.
 -module(etap).
+-vsn("0.3.4").
+
 -export([
-    ensure_test_server/0, start_etap_server/0, test_server/1,
-    diag/1, diag/2, plan/1, end_tests/0, not_ok/2, ok/2, is/3, isnt/3,
-    any/3, none/3, fun_is/3, is_greater/3, skip/1, skip/2,
-    ensure_coverage_starts/0, ensure_coverage_ends/0, coverage_report/0,
-    datetime/1, skip/3, bail/0, bail/1
+    ensure_test_server/0,
+    start_etap_server/0,
+    test_server/1,
+    msg/1, msg/2,
+    diag/1, diag/2,
+    expectation_mismatch_message/3,
+    plan/1,
+    end_tests/0,
+    not_ok/2, ok/2, is_ok/2, is/3, isnt/3, any/3, none/3,
+    fun_is/3, expect_fun/3, expect_fun/4,
+    is_greater/3,
+    skip/1, skip/2,
+    datetime/1,
+    skip/3,
+    bail/0, bail/1,
+    test_state/0, failure_count/0
+]).
+
+-export([
+    contains_ok/3,
+    is_before/4
+]).
+
+-export([
+    is_pid/2,
+    is_alive/2,
+    is_mfa/3
+]).
+
+-export([
+    loaded_ok/2,
+    can_ok/2, can_ok/3,
+    has_attrib/2, is_attrib/3,
+    is_behaviour/2
+]).
+
+-export([
+    dies_ok/2,
+    lives_ok/2,
+    throws_ok/3
 ]).
--record(test_state, {planned = 0, count = 0, pass = 0, fail = 0, skip = 0, skip_reason = ""}).
--vsn("0.3.4").
+
+
+-record(test_state, {
+    planned = 0,
+    count = 0,
+    pass = 0,
+    fail = 0,
+    skip = 0,
+    skip_reason = ""
+}).
 
 %% @spec plan(N) -> Result
 %%       N = unknown | skip | {skip, string()} | integer()
 %%       Result = ok
 %% @doc Create a test plan and boot strap the test server.
 plan(unknown) ->
-    ensure_coverage_starts(),
     ensure_test_server(),
     etap_server ! {self(), plan, unknown},
     ok;
@@ -68,7 +112,6 @@ plan(skip) ->
 plan({skip, Reason}) ->
     io:format("1..0 # skip ~s~n", [Reason]);
 plan(N) when is_integer(N), N > 0 ->
-    ensure_coverage_starts(),
     ensure_test_server(),
     etap_server ! {self(), plan, N},
     ok.
@@ -78,8 +121,10 @@ plan(N) when is_integer(N), N > 0 ->
 %% @todo This should probably be done in the test_server process.
 end_tests() ->
     timer:sleep(100),
-    ensure_coverage_ends(),
-    etap_server ! {self(), state},
+    case whereis(etap_server) of
+        undefined -> self() ! true;
+        _ -> etap_server ! {self(), state}
+    end,
     State = receive X -> X end,
     if
         State#test_state.planned == -1 ->
@@ -92,58 +137,52 @@ end_tests() ->
         _ -> etap_server ! done, ok
     end.
 
-%% @private
-ensure_coverage_starts() ->
-    case os:getenv("COVER") of
-        false -> ok;
-        _ ->
-            BeamDir = case os:getenv("COVER_BIN") of false -> "ebin"; X -> X end,
-            cover:compile_beam_directory(BeamDir)
-    end.
-
-%% @private
-%% @doc Attempts to write out any collected coverage data to the cover/
-%% directory. This function should not be called externally, but it could be.
-ensure_coverage_ends() ->
-    case os:getenv("COVER") of
-        false -> ok;
-        _ ->
-            filelib:ensure_dir("cover/"),
-            Name = lists:flatten([
-                io_lib:format("~.16b", [X]) || X <- binary_to_list(erlang:md5(
-                     term_to_binary({make_ref(), now()})
-                ))
-            ]),
-            cover:export("cover/" ++ Name ++ ".coverdata")
-    end.
-
-%% @spec coverage_report() -> ok
-%% @doc Use the cover module's covreage report builder to create code coverage
-%% reports from recently created coverdata files.
-coverage_report() ->
-    [cover:import(File) || File <- filelib:wildcard("cover/*.coverdata")],
-    lists:foreach(
-        fun(Mod) ->
-            cover:analyse_to_file(Mod, atom_to_list(Mod) ++ "_coverage.txt", [])
-        end,
-        cover:imported_modules()
-    ),
-    ok.
-
 bail() ->
     bail("").
 
 bail(Reason) ->
     etap_server ! {self(), diag, "Bail out! " ++ Reason},
-    ensure_coverage_ends(),
     etap_server ! done, ok,
     ok.
 
+%% @spec test_state() -> Return
+%%       Return = test_state_record() | {error, string()}
+%% @doc Return the current test state
+test_state() ->
+    etap_server ! {self(), state},
+    receive
+	X when is_record(X, test_state) -> X
+    after
+	1000 -> {error, "Timed out waiting for etap server reply.~n"}
+    end.
+
+%% @spec failure_count() -> Return
+%%       Return = integer() | {error, string()}
+%% @doc Return the current failure count
+failure_count() ->
+    case test_state() of
+        #test_state{fail=FailureCount} -> FailureCount;
+        X -> X
+    end.
+
+%% @spec msg(S) -> ok
+%%       S = string()
+%% @doc Print a message in the test output.
+msg(S) -> etap_server ! {self(), diag, S}, ok.
+
+%% @spec msg(Format, Data) -> ok
+%%      Format = atom() | string() | binary()
+%%      Data = [term()]
+%%      UnicodeList = [Unicode]
+%%      Unicode = int()
+%% @doc Print a message in the test output.
+%% Function arguments are passed through io_lib:format/2.
+msg(Format, Data) -> msg(io_lib:format(Format, Data)).
 
 %% @spec diag(S) -> ok
 %%       S = string()
 %% @doc Print a debug/status message related to the test suite.
-diag(S) -> etap_server ! {self(), diag, "# " ++ S}, ok.
+diag(S) -> msg("# " ++ S).
 
 %% @spec diag(Format, Data) -> ok
 %%      Format = atom() | string() | binary()
@@ -154,19 +193,56 @@ diag(S) -> etap_server ! {self(), diag, "# " ++ S}, ok.
 %% Function arguments are passed through io_lib:format/2.
 diag(Format, Data) -> diag(io_lib:format(Format, Data)).
 
+%% @spec expectation_mismatch_message(Got, Expected, Desc) -> ok
+%%       Got = any()
+%%       Expected = any()
+%%       Desc = string()
+%% @doc Print an expectation mismatch message in the test output.
+expectation_mismatch_message(Got, Expected, Desc) ->
+    msg("    ---"),
+    msg("    description: ~p", [Desc]),
+    msg("    found:       ~p", [Got]),
+    msg("    wanted:      ~p", [Expected]),
+    msg("    ..."),
+    ok.
+
+% @spec evaluate(Pass, Got, Expected, Desc) -> Result
+%%       Pass = true | false
+%%       Got = any()
+%%       Expected = any()
+%%       Desc = string()
+%%       Result = true | false
+%% @doc Evaluate a test statement, printing an expectation mismatch message
+%%       if the test failed.
+evaluate(Pass, Got, Expected, Desc) ->
+    case mk_tap(Pass, Desc) of
+        false ->
+            expectation_mismatch_message(Got, Expected, Desc),
+            false;
+        true ->
+            true
+    end.
+
 %% @spec ok(Expr, Desc) -> Result
 %%       Expr = true | false
 %%       Desc = string()
 %%       Result = true | false
 %% @doc Assert that a statement is true.
-ok(Expr, Desc) -> mk_tap(Expr == true, Desc).
+ok(Expr, Desc) -> evaluate(Expr == true, Expr, true, Desc).
 
 %% @spec not_ok(Expr, Desc) -> Result
 %%       Expr = true | false
 %%       Desc = string()
 %%       Result = true | false
 %% @doc Assert that a statement is false.
-not_ok(Expr, Desc) -> mk_tap(Expr == false, Desc).
+not_ok(Expr, Desc) -> evaluate(Expr == false, Expr, false, Desc).
+
+%% @spec is_ok(Expr, Desc) -> Result
+%%       Expr = any()
+%%       Desc = string()
+%%       Result = true | false
+%% @doc Assert that two values are the same.
+is_ok(Expr, Desc) -> evaluate(Expr == ok, Expr, ok, Desc).
 
 %% @spec is(Got, Expected, Desc) -> Result
 %%       Got = any()
@@ -174,17 +250,7 @@ not_ok(Expr, Desc) -> mk_tap(Expr == false, Desc).
 %%       Desc = string()
 %%       Result = true | false
 %% @doc Assert that two values are the same.
-is(Got, Expected, Desc) ->
-    case mk_tap(Got == Expected, Desc) of
-        false ->
-            etap_server ! {self(), diag, "    ---"},
-            etap_server ! {self(), diag, io_lib:format("    description: ~p", [Desc])},
-            etap_server ! {self(), diag, io_lib:format("    found:       ~p", [Got])},
-            etap_server ! {self(), diag, io_lib:format("    wanted:      ~p", [Expected])},
-            etap_server ! {self(), diag, "    ..."},
-            false;
-        true -> true
-    end.
+is(Got, Expected, Desc) -> evaluate(Got == Expected, Got, Expected, Desc).
 
 %% @spec isnt(Got, Expected, Desc) -> Result
 %%       Got = any()
@@ -192,7 +258,7 @@ is(Got, Expected, Desc) ->
 %%       Desc = string()
 %%       Result = true | false
 %% @doc Assert that two values are not the same.
-isnt(Got, Expected, Desc) -> mk_tap(Got /= Expected, Desc).
+isnt(Got, Expected, Desc) -> evaluate(Got /= Expected, Got, Expected, Desc).
 
 %% @spec is_greater(ValueA, ValueB, Desc) -> Result
 %%       ValueA = number()
@@ -209,6 +275,8 @@ is_greater(ValueA, ValueB, Desc) when is_integer(ValueA), is_integer(ValueB) ->
 %%       Desc = string()
 %%       Result = true | false
 %% @doc Assert that an item is in a list.
+any(Got, Items, Desc) when is_function(Got) ->
+    is(lists:any(Got, Items), true, Desc);
 any(Got, Items, Desc) ->
     is(lists:member(Got, Items), true, Desc).
 
@@ -218,6 +286,8 @@ any(Got, Items, Desc) ->
 %%       Desc = string()
 %%       Result = true | false
 %% @doc Assert that an item is not in a list.
+none(Got, Items, Desc) when is_function(Got) ->
+    is(lists:any(Got, Items), false, Desc);
 none(Got, Items, Desc) ->
     is(lists:member(Got, Items), false, Desc).
 
@@ -230,6 +300,27 @@ none(Got, Items, Desc) ->
 fun_is(Fun, Expected, Desc) when is_function(Fun) ->
     is(Fun(Expected), true, Desc).
 
+%% @spec expect_fun(ExpectFun, Got, Desc) -> Result
+%%       ExpectFun = function()
+%%       Got = any()
+%%       Desc = string()
+%%       Result = true | false
+%% @doc Use an anonymous function to assert a pattern match, using actual
+%%       value as the argument to the function.
+expect_fun(ExpectFun, Got, Desc) ->
+    evaluate(ExpectFun(Got), Got, ExpectFun, Desc).
+
+%% @spec expect_fun(ExpectFun, Got, Desc, ExpectStr) -> Result
+%%       ExpectFun = function()
+%%       Got = any()
+%%       Desc = string()
+%%       ExpectStr = string()
+%%       Result = true | false
+%% @doc Use an anonymous function to assert a pattern match, using actual
+%%       value as the argument to the function.
+expect_fun(ExpectFun, Got, Desc, ExpectStr) ->
+    evaluate(ExpectFun(Got), Got, ExpectStr, Desc).
+
 %% @equiv skip(TestFun, "")
 skip(TestFun) when is_function(TestFun) ->
     skip(TestFun, "").
@@ -276,8 +367,113 @@ begin_skip(Reason) ->
 end_skip() ->
     etap_server ! {self(), end_skip}.
 
-% ---
-% Internal / Private functions
+%% @spec contains_ok(string(), string(), string()) -> true | false
+%% @doc Assert that a string is contained in another string.
+contains_ok(Source, String, Desc) ->
+    etap:isnt(
+        string:str(Source, String),
+        0,
+        Desc
+    ).
+
+%% @spec is_before(string(), string(), string(), string()) -> true | false
+%% @doc Assert that a string comes before another string within a larger body.
+is_before(Source, StringA, StringB, Desc) ->
+    etap:is_greater(
+        string:str(Source, StringB),
+        string:str(Source, StringA),
+        Desc
+    ).
+
+%% @doc Assert that a given variable is a pid.
+is_pid(Pid, Desc) when is_pid(Pid) -> etap:ok(true, Desc);
+is_pid(_, Desc) -> etap:ok(false, Desc).
+
+%% @doc Assert that a given process/pid is alive.
+is_alive(Pid, Desc) ->
+    etap:ok(erlang:is_process_alive(Pid), Desc).
+
+%% @doc Assert that the current function of a pid is a given {M, F, A} tuple.
+is_mfa(Pid, MFA, Desc) ->
+    etap:is({current_function, MFA}, erlang:process_info(Pid, current_function), Desc).
+
+%% @spec loaded_ok(atom(), string()) -> true | false
+%% @doc Assert that a module has been loaded successfully.
+loaded_ok(M, Desc) when is_atom(M) ->
+    etap:fun_is(fun({module, _}) -> true; (_) -> false end, code:load_file(M), Desc).
+
+%% @spec can_ok(atom(), atom()) -> true | false
+%% @doc Assert that a module exports a given function.
+can_ok(M, F) when is_atom(M), is_atom(F) ->
+    Matches = [X || {X, _} <- M:module_info(exports), X == F],
+    etap:ok(Matches > 0, lists:concat([M, " can ", F])).
+
+%% @spec can_ok(atom(), atom(), integer()) -> true | false
+%% @doc Assert that a module exports a given function with a given arity.
+can_ok(M, F, A) when is_atom(M); is_atom(F), is_number(A) ->
+    Matches = [X || X <- M:module_info(exports), X == {F, A}],
+    etap:ok(Matches > 0, lists:concat([M, " can ", F, "/", A])).
+
+%% @spec has_attrib(M, A) -> true | false
+%%       M = atom()
+%%       A = atom()
+%% @doc Asserts that a module has a given attribute.
+has_attrib(M, A) when is_atom(M), is_atom(A) ->
+    etap:isnt(
+        proplists:get_value(A, M:module_info(attributes), 'asdlkjasdlkads'),
+        'asdlkjasdlkads',
+        lists:concat([M, " has attribute ", A])
+    ).
+
+%% @spec has_attrib(M, A. V) -> true | false
+%%       M = atom()
+%%       A = atom()
+%%       V = any()
+%% @doc Asserts that a module has a given attribute with a given value.
+is_attrib(M, A, V) when is_atom(M) andalso is_atom(A) ->
+    etap:is(
+        proplists:get_value(A, M:module_info(attributes)),
+        [V],
+        lists:concat([M, "'s ", A, " is ", V])
+    ).
+
+%% @spec is_behavior(M, B) -> true | false
+%%       M = atom()
+%%       B = atom()
+%% @doc Asserts that a given module has a specific behavior.
+is_behaviour(M, B) when is_atom(M) andalso is_atom(B) ->
+    is_attrib(M, behaviour, B).
+
+%% @doc Assert that an exception is raised when running a given function.
+dies_ok(F, Desc) ->
+    case (catch F()) of
+        {'EXIT', _} -> etap:ok(true, Desc);
+        _ -> etap:ok(false, Desc)
+    end.
+
+%% @doc Assert that an exception is not raised when running a given function.
+lives_ok(F, Desc) ->
+    etap:is(try_this(F), success, Desc).
+
+%% @doc Assert that the exception thrown by a function matches the given exception.
+throws_ok(F, Exception, Desc) ->
+    try F() of
+        _ -> etap:ok(nok, Desc)
+    catch
+        _:E ->
+            etap:is(E, Exception, Desc)
+    end.
+
+%% @private
+%% @doc Run a function and catch any exceptions.
+try_this(F) when is_function(F, 0) ->
+    try F() of
+        _ -> success
+    catch
+        throw:E -> {throw, E};
+        error:E -> {error, E};
+        exit:E -> {exit, E}
+    end.
 
 %% @private
 %% @doc Start the etap_server process if it is not running already.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/etap/etap_application.erl
----------------------------------------------------------------------
diff --git a/src/etap/etap_application.erl b/src/etap/etap_application.erl
deleted file mode 100644
index 98b5275..0000000
--- a/src/etap/etap_application.erl
+++ /dev/null
@@ -1,72 +0,0 @@
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
-%% 
-%% Permission is hereby granted, free of charge, to any person
-%% obtaining a copy of this software and associated documentation
-%% files (the "Software"), to deal in the Software without
-%% restriction, including without limitation the rights to use,
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
-%% copies of the Software, and to permit persons to whom the
-%% Software is furnished to do so, subject to the following
-%% conditions:
-%% 
-%% The above copyright notice and this permission notice shall be
-%% included in all copies or substantial portions of the Software.
-%% 
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-%% OTHER DEALINGS IN THE SOFTWARE.
-%%
-%% @author Nick Gerakines <nick@gerakines.net> [http://socklabs.com/]
-%% @copyright 2008 Nick Gerakines
-%% @reference http://testanything.org/wiki/index.php/Main_Page
-%% @reference http://en.wikipedia.org/wiki/Test_Anything_Protocol
-%% @todo Explain in documentation why we use a process to handle test input.
-%% @todo Add test to verify the number of members in a pg2 group.
-%% @doc Provide test functionality to the application and related behaviors.
--module(etap_application).
--export([
-    start_ok/2, ensure_loaded/3, load_ok/2,
-    pg2_group_exists/2, pg2_group_doesntexist/2
-]).
-
-%% @spec load_ok(string(), string()) -> true | false
-%% @doc Assert that an application can be loaded successfully.
-load_ok(AppName, Desc) ->
-    etap:ok(application:load(AppName) == ok, Desc).
-
-%% @spec start_ok(string(), string()) -> true | false
-%% @doc Assert that an application can be started successfully.
-start_ok(AppName, Desc) ->
-    etap:ok(application:start(AppName) == ok, Desc).
-
-%% @spec ensure_loaded(string(), string(), string()) -> true | false
-%% @doc Assert that an application has been loaded successfully.
-ensure_loaded(AppName, AppVsn, Desc) ->
-    etap:any(
-        fun(Match) -> case Match of {AppName, _, AppVsn} -> true; _ -> false end end,
-        application:loaded_applications(),
-        Desc
-    ).
-
-%% @spec pg2_group_exists(string(), string()) -> true | false
-%% @doc Assert that a pg2 group exists.
-pg2_group_exists(GroupName, Desc) ->
-    etap:any(
-        fun(Match) -> Match == GroupName end,
-        pg2:which_groups(),
-        Desc
-    ).
-
-%% @spec pg2_group_doesntexist(string(), string()) -> true | false
-%% @doc Assert that a pg2 group does not exists.
-pg2_group_doesntexist(GroupName, Desc) ->
-    etap:none(
-        fun(Match) -> Match == GroupName end,
-        pg2:which_groups(),
-        Desc
-    ).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/etap/etap_can.erl
----------------------------------------------------------------------
diff --git a/src/etap/etap_can.erl b/src/etap/etap_can.erl
deleted file mode 100644
index 552b717..0000000
--- a/src/etap/etap_can.erl
+++ /dev/null
@@ -1,79 +0,0 @@
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
-%% 
-%% Permission is hereby granted, free of charge, to any person
-%% obtaining a copy of this software and associated documentation
-%% files (the "Software"), to deal in the Software without
-%% restriction, including without limitation the rights to use,
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
-%% copies of the Software, and to permit persons to whom the
-%% Software is furnished to do so, subject to the following
-%% conditions:
-%% 
-%% The above copyright notice and this permission notice shall be
-%% included in all copies or substantial portions of the Software.
-%% 
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-%% OTHER DEALINGS IN THE SOFTWARE.
-%%
-%% @reference http://testanything.org/wiki/index.php/Main_Page
-%% @reference http://en.wikipedia.org/wiki/Test_Anything_Protocol
-%% @doc Provide test functionality modules
--module(etap_can).
-
--export([
-    loaded_ok/2, can_ok/2, can_ok/3,
-    has_attrib/2, is_attrib/3, is_behaviour/2
-]).
-
-%% @spec loaded_ok(atom(), string()) -> true | false
-%% @doc Assert that a module has been loaded successfully.
-loaded_ok(M, Desc) when is_atom(M) ->
-    etap:fun_is(fun({module, _}) -> true; (_) -> false end, code:load_file(M), Desc).
-
-%% @spec can_ok(atom(), atom()) -> true | false
-%% @doc Assert that a module exports a given function.
-can_ok(M, F) when is_atom(M), is_atom(F) ->
-    Matches = [X || {X, _} <- M:module_info(exports), X == F],
-    etap:ok(Matches > 0, lists:concat([M, " can ", F])).
-
-%% @spec can_ok(atom(), atom(), integer()) -> true | false
-%% @doc Assert that a module exports a given function with a given arity.
-can_ok(M, F, A) when is_atom(M); is_atom(F), is_number(A) ->
-    Matches = [X || X <- M:module_info(exports), X == {F, A}],
-    etap:ok(Matches > 0, lists:concat([M, " can ", F, "/", A])).
-
-%% @spec has_attrib(M, A) -> true | false
-%%       M = atom()
-%%       A = atom()
-%% @doc Asserts that a module has a given attribute.
-has_attrib(M, A) when is_atom(M), is_atom(A) ->
-    etap:isnt(
-        proplists:get_value(A, M:module_info(attributes), 'asdlkjasdlkads'),
-        'asdlkjasdlkads',
-        lists:concat([M, " has attribute ", A])
-    ).
-
-%% @spec has_attrib(M, A. V) -> true | false
-%%       M = atom()
-%%       A = atom()
-%%       V = any()
-%% @doc Asserts that a module has a given attribute with a given value.
-is_attrib(M, A, V) when is_atom(M) andalso is_atom(A) ->
-    etap:is(
-        proplists:get_value(A, M:module_info(attributes)),
-        [V],
-        lists:concat([M, "'s ", A, " is ", V])
-    ).
-
-%% @spec is_behavior(M, B) -> true | false
-%%       M = atom()
-%%       B = atom()
-%% @doc Asserts that a given module has a specific behavior.
-is_behaviour(M, B) when is_atom(M) andalso is_atom(B) ->
-    is_attrib(M, behaviour, B).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/etap/etap_exception.erl
----------------------------------------------------------------------
diff --git a/src/etap/etap_exception.erl b/src/etap/etap_exception.erl
deleted file mode 100644
index ba66072..0000000
--- a/src/etap/etap_exception.erl
+++ /dev/null
@@ -1,66 +0,0 @@
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
-%% 
-%% Permission is hereby granted, free of charge, to any person
-%% obtaining a copy of this software and associated documentation
-%% files (the "Software"), to deal in the Software without
-%% restriction, including without limitation the rights to use,
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
-%% copies of the Software, and to permit persons to whom the
-%% Software is furnished to do so, subject to the following
-%% conditions:
-%% 
-%% The above copyright notice and this permission notice shall be
-%% included in all copies or substantial portions of the Software.
-%% 
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-%% OTHER DEALINGS IN THE SOFTWARE.
-%%
-%% @reference http://testanything.org/wiki/index.php/Main_Page
-%% @reference http://en.wikipedia.org/wiki/Test_Anything_Protocol
-%% @doc Adds exception based testing to the etap suite.
--module(etap_exception).
-
--export([dies_ok/2, lives_ok/2, throws_ok/3]).
-
-% ---
-% External / Public functions
-
-%% @doc Assert that an exception is raised when running a given function.
-dies_ok(F, Desc) ->
-    case (catch F()) of
-        {'EXIT', _} -> etap:ok(true, Desc);
-        _ -> etap:ok(false, Desc)
-    end.
-
-%% @doc Assert that an exception is not raised when running a given function.
-lives_ok(F, Desc) ->
-    etap:is(try_this(F), success, Desc).
-
-%% @doc Assert that the exception thrown by a function matches the given exception.
-throws_ok(F, Exception, Desc) ->
-    try F() of
-        _ -> etap:ok(nok, Desc)
-    catch
-        _:E ->
-            etap:is(E, Exception, Desc)
-    end.
-
-% ---
-% Internal / Private functions
-
-%% @private
-%% @doc Run a function and catch any exceptions.
-try_this(F) when is_function(F, 0) ->
-    try F() of
-        _ -> success
-    catch
-        throw:E -> {throw, E};
-        error:E -> {error, E};
-        exit:E -> {exit, E}
-    end.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/etap/etap_process.erl
----------------------------------------------------------------------
diff --git a/src/etap/etap_process.erl b/src/etap/etap_process.erl
deleted file mode 100644
index 69f5ba0..0000000
--- a/src/etap/etap_process.erl
+++ /dev/null
@@ -1,42 +0,0 @@
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
-%% 
-%% Permission is hereby granted, free of charge, to any person
-%% obtaining a copy of this software and associated documentation
-%% files (the "Software"), to deal in the Software without
-%% restriction, including without limitation the rights to use,
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
-%% copies of the Software, and to permit persons to whom the
-%% Software is furnished to do so, subject to the following
-%% conditions:
-%% 
-%% The above copyright notice and this permission notice shall be
-%% included in all copies or substantial portions of the Software.
-%% 
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-%% OTHER DEALINGS IN THE SOFTWARE.
-%%
-%% @doc Adds process/pid testing to the etap suite.
--module(etap_process).
-
--export([is_pid/2, is_alive/2, is_mfa/3]).
-
-% ---
-% External / Public functions
-
-%% @doc Assert that a given variable is a pid.
-is_pid(Pid, Desc) when is_pid(Pid) -> etap:ok(true, Desc);
-is_pid(_, Desc) -> etap:ok(false, Desc).
-
-%% @doc Assert that a given process/pid is alive.
-is_alive(Pid, Desc) ->
-    etap:ok(erlang:is_process_alive(Pid), Desc).
-
-%% @doc Assert that the current function of a pid is a given {M, F, A} tuple.
-is_mfa(Pid, MFA, Desc) ->
-    etap:is({current_function, MFA}, erlang:process_info(Pid, current_function), Desc).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/etap/etap_report.erl
----------------------------------------------------------------------
diff --git a/src/etap/etap_report.erl b/src/etap/etap_report.erl
deleted file mode 100644
index 6d692fb..0000000
--- a/src/etap/etap_report.erl
+++ /dev/null
@@ -1,343 +0,0 @@
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
-%% 
-%% Permission is hereby granted, free of charge, to any person
-%% obtaining a copy of this software and associated documentation
-%% files (the "Software"), to deal in the Software without
-%% restriction, including without limitation the rights to use,
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
-%% copies of the Software, and to permit persons to whom the
-%% Software is furnished to do so, subject to the following
-%% conditions:
-%% 
-%% The above copyright notice and this permission notice shall be
-%% included in all copies or substantial portions of the Software.
-%% 
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-%% OTHER DEALINGS IN THE SOFTWARE.
-%%
-%% @doc A module for creating nice looking code coverage reports.
--module(etap_report).
--export([create/0]).
-
-%% @spec create() -> ok
-%% @doc Create html code coverage reports for each module that code coverage
-%% data exists for.
-create() ->
-    [cover:import(File) || File <- filelib:wildcard("cover/*.coverdata")],
-    Modules = lists:foldl(
-        fun(Module, Acc) ->
-            [{Module, file_report(Module)} | Acc]
-        end,
-        [],
-        cover:imported_modules()
-    ),
-    index(Modules).
-
-%% @private
-index(Modules) ->
-    {ok, IndexFD} = file:open("cover/index.html", [write]),
-    io:format(IndexFD, "<html><head><style>
-    table.percent_graph { height: 12px; border:1px solid #E2E6EF; empty-cells: show; }
-    table.percent_graph td.covered { height: 10px; background: #00f000; }
-    table.percent_graph td.uncovered { height: 10px; background: #e00000; }
-    .odd { background-color: #ddd; }
-    .even { background-color: #fff; }
-    </style></head>", []),
-    io:format(IndexFD, "<body>", []),
-    lists:foldl(
-        fun({Module, {Good, Bad, Source}}, LastRow) ->
-            case {Good + Bad, Source} of
-                {0, _} -> LastRow;
-                {_, none} -> LastRow;
-                _ ->
-                    CovPer = round((Good / (Good + Bad)) * 100),
-                    UnCovPer = round((Bad / (Good + Bad)) * 100),
-                    RowClass = case LastRow of 1 -> "odd"; _ -> "even" end,
-                    io:format(IndexFD, "<div class=\"~s\">", [RowClass]),
-                    io:format(IndexFD, "<a href=\"~s\">~s</a>", [atom_to_list(Module) ++ "_report.html", atom_to_list(Module)]),
-                    io:format(IndexFD, "
-                    <table cellspacing='0' cellpadding='0' align='right'>
-                      <tr>
-                        <td><tt>~p%</tt>&nbsp;</td><td>
-                          <table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
-                          <tr><td class='covered' width='~p' /><td class='uncovered' width='~p' /></tr>
-                          </table>
-                        </td>
-                      </tr>
-                    </table>
-                    ", [CovPer, CovPer, UnCovPer]),
-                    io:format(IndexFD, "</div>", []),
-                    case LastRow of
-                        1 -> 0;
-                        0 -> 1
-                    end
-            end
-        end,
-        0,
-        lists:sort(Modules)
-    ),
-    {TotalGood, TotalBad} = lists:foldl(
-        fun({_, {Good, Bad, Source}}, {TGood, TBad}) ->
-            case Source of none -> {TGood, TBad}; _ -> {TGood + Good, TBad + Bad} end
-        end,
-        {0, 0},
-        Modules
-    ),
-    io:format(IndexFD, "<p>Generated on ~s.</p>~n", [etap:datetime({date(), time()})]),
-    case TotalGood + TotalBad of
-        0 -> ok;
-        _ ->
-            TotalCovPer = round((TotalGood / (TotalGood + TotalBad)) * 100),
-            TotalUnCovPer = round((TotalBad / (TotalGood + TotalBad)) * 100),
-            io:format(IndexFD, "<div>", []),
-            io:format(IndexFD, "Total 
-            <table cellspacing='0' cellpadding='0' align='right'>
-              <tr>
-                <td><tt>~p%</tt>&nbsp;</td><td>
-                  <table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
-                  <tr><td class='covered' width='~p' /><td class='uncovered' width='~p' /></tr>
-                  </table>
-                </td>
-              </tr>
-            </table>
-            ", [TotalCovPer, TotalCovPer, TotalUnCovPer]),
-            io:format(IndexFD, "</div>", [])
-    end,
-    io:format(IndexFD, "</body></html>", []),
-    file:close(IndexFD),
-    ok.
-
-%% @private
-file_report(Module) ->
-    {ok, Data} = cover:analyse(Module, calls, line),
-    Source = find_source(Module),
-    {Good, Bad} = collect_coverage(Data, {0, 0}),
-    case {Source, Good + Bad} of
-        {none, _} -> ok;
-        {_, 0} -> ok;
-        _ ->
-            {ok, SourceFD} = file:open(Source, [read]),
-            {ok, WriteFD} = file:open("cover/" ++ atom_to_list(Module) ++ "_report.html", [write]),
-            io:format(WriteFD, "~s", [header(Module, Good, Bad)]),
-            output_lines(Data, WriteFD, SourceFD, 1),
-            io:format(WriteFD, "~s", [footer()]),
-            file:close(WriteFD),
-            file:close(SourceFD),
-            ok
-    end,
-    {Good, Bad, Source}.
-
-%% @private
-collect_coverage([], Acc) -> Acc;
-collect_coverage([{{_, _}, 0} | Data], {Good, Bad}) ->
-    collect_coverage(Data, {Good, Bad + 1});
-collect_coverage([_ | Data], {Good, Bad}) ->
-    collect_coverage(Data, {Good + 1, Bad}).
-
-%% @private
-output_lines(Data, WriteFD, SourceFD, LineNumber) ->
-    {Match, NextData} = datas_match(Data, LineNumber),
-    case io:get_line(SourceFD, '') of
-        eof -> ok;
-        Line = "%% @todo" ++ _ ->
-            io:format(WriteFD, "~s", [out_line(LineNumber, highlight, Line)]),
-            output_lines(NextData, WriteFD, SourceFD, LineNumber + 1);
-        Line = "% " ++ _ ->
-            io:format(WriteFD, "~s", [out_line(LineNumber, none, Line)]),
-            output_lines(NextData, WriteFD, SourceFD, LineNumber + 1);
-        Line ->
-            case Match of
-                {true, CC} ->
-                    io:format(WriteFD, "~s", [out_line(LineNumber, CC, Line)]),
-                    output_lines(NextData, WriteFD, SourceFD, LineNumber + 1);
-                false ->
-                    io:format(WriteFD, "~s", [out_line(LineNumber, none, Line)]),
-                    output_lines(NextData, WriteFD, SourceFD, LineNumber + 1)
-            end
-    end.
-
-%% @private
-out_line(Number, none, Line) ->
-    PadNu = string:right(integer_to_list(Number), 5, $.),
-    io_lib:format("<span class=\"marked\"><a name=\"line~p\"></a>~s ~s</span>", [Number, PadNu, Line]);
-out_line(Number, highlight, Line) ->
-    PadNu = string:right(integer_to_list(Number), 5, $.),
-    io_lib:format("<span class=\"highlight\"><a name=\"line~p\"></a>~s ~s</span>", [Number, PadNu, Line]);
-out_line(Number, 0, Line) ->
-    PadNu = string:right(integer_to_list(Number), 5, $.),
-    io_lib:format("<span class=\"uncovered\"><a name=\"line~p\"></a>~s ~s</span>", [Number, PadNu, Line]);
-out_line(Number, _, Line) ->
-    PadNu = string:right(integer_to_list(Number), 5, $.),
-    io_lib:format("<span class=\"covered\"><a name=\"line~p\"></a>~s ~s</span>", [Number, PadNu, Line]).
-
-%% @private
-datas_match([], _) -> {false, []};
-datas_match([{{_, Line}, CC} | Datas], LineNumber) when Line == LineNumber -> {{true, CC}, Datas};
-datas_match(Data, _) -> {false, Data}.
-
-%% @private
-find_source(Module) when is_atom(Module) ->
-    Root = filename:rootname(Module),
-    Dir = filename:dirname(Root),
-    XDir = case os:getenv("SRC") of false -> "src"; X -> X end,
-    find_source([
-        filename:join([Dir, Root ++ ".erl"]),
-        filename:join([Dir, "..", "src", Root ++ ".erl"]),
-        filename:join([Dir, "src", Root ++ ".erl"]),
-        filename:join([Dir, "elibs", Root ++ ".erl"]),
-        filename:join([Dir, "..", "elibs", Root ++ ".erl"]),
-        filename:join([Dir, XDir, Root ++ ".erl"])
-    ]);
-find_source([]) -> none;
-find_source([Test | Tests]) ->
-    case filelib:is_file(Test) of
-        true -> Test;
-        false -> find_source(Tests)
-    end.
-
-%% @private
-header(Module, Good, Bad) ->
-    io:format("Good ~p~n", [Good]),
-    io:format("Bad ~p~n", [Bad]),
-    CovPer = round((Good / (Good + Bad)) * 100),
-    UnCovPer = round((Bad / (Good + Bad)) * 100),
-    io:format("CovPer ~p~n", [CovPer]),
-    io_lib:format("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
-        <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
-          <head>
-            <title>~s - C0 code coverage information</title>
-            <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style>
-            <style type='text/css'>span.marked0 {
-     background-color: rgb(185, 210, 200);
-     display: block;
-    }
-    span.marked { display: block; background-color: #ffffff; }
-    span.highlight { display: block; background-color: #fff9d7; }
-    span.covered { display: block; background-color: #f7f7f7 ; }
-    span.uncovered { display: block; background-color: #ffebe8 ; }
-    span.overview {
-     border-bottom: 1px solid #E2E6EF; 
-    }
-    div.overview {
-     border-bottom: 1px solid #E2E6EF; 
-    }
-    body {
-     font-family: verdana, arial, helvetica;
-    }
-    div.footer {
-     font-size: 68%;
-     margin-top: 1.5em;
-    }
-    h1, h2, h3, h4, h5, h6 {
-     margin-bottom: 0.5em;
-    }
-    h5 {
-     margin-top: 0.5em;
-    }
-    .hidden {
-     display: none;
-    }
-    div.separator {
-     height: 10px;
-    }
-    table.percent_graph {
-     height: 12px;
-     border: 1px solid #E2E6EF; 
-     empty-cells: show;
-    }
-    table.percent_graph td.covered {
-     height: 10px;
-     background: #00f000;
-    }
-    table.percent_graph td.uncovered {
-     height: 10px;
-     background: #e00000;
-    }
-    table.percent_graph td.NA {
-     height: 10px;
-     background: #eaeaea;
-    }
-    table.report {
-     border-collapse: collapse;
-     width: 100%;
-    }
-    table.report td.heading {
-     background: #dcecff;
-     border: 1px solid #E2E6EF; 
-     font-weight: bold;
-     text-align: center;
-    }
-    table.report td.heading:hover {
-     background: #c0ffc0;
-    }
-    table.report td.text {
-     border: 1px solid #E2E6EF; 
-    }
-    table.report td.value {
-     text-align: right;
-     border: 1px solid #E2E6EF; 
-    }
-    table.report tr.light {
-     background-color: rgb(240, 240, 245);
-    }
-    table.report tr.dark {
-     background-color: rgb(230, 230, 235);
-    }
-    </style>
-          </head>
-          <body>
-            <h3>C0 code coverage information</h3>
-            <p>Generated on ~s with <a href='http://github.com/ngerakines/etap'>etap 0.3.4</a>.
-            </p>            
-        <table class='report'>
-          <thead>
-            <tr>
-              <td class='heading'>Name</td>
-              <td class='heading'>Total lines</td>
-              <td class='heading'>Lines of code</td>
-              <td class='heading'>Total coverage</td>
-              <td class='heading'>Code coverage</td>
-            </tr>
-          </thead>
-          <tbody>
-            <tr class='light'>
-
-              <td>
-                <a href='~s'>~s</a>
-              </td>
-              <td class='value'>
-                <tt>??</tt>
-              </td>
-              <td class='value'>
-                <tt>??</tt>
-              </td>
-              <td class='value'>
-                <tt>??</tt>
-              </td>
-              <td>
-                <table cellspacing='0' cellpadding='0' align='right'>
-                  <tr>
-                    <td><tt>~p%</tt>&nbsp;</td><td>
-                      <table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
-                      <tr><td class='covered' width='~p' /><td class='uncovered' width='~p' /></tr>
-                      </table>
-                    </td>
-                  </tr>
-                </table>
-              </td>
-            </tr>
-          </tbody>
-        </table><pre>", [Module, etap:datetime({date(), time()}), atom_to_list(Module) ++ "_report.html", Module, CovPer, CovPer, UnCovPer]).
-
-%% @private
-footer() ->
-    "</pre><hr /><p>Generated using <a href='http://github.com/ngerakines/etap'>etap 0.3.4</a>.</p>
-          </body>
-        </html>
-    ".

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/etap/etap_request.erl
----------------------------------------------------------------------
diff --git a/src/etap/etap_request.erl b/src/etap/etap_request.erl
deleted file mode 100644
index 9fd23ac..0000000
--- a/src/etap/etap_request.erl
+++ /dev/null
@@ -1,89 +0,0 @@
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
-%% 
-%% Permission is hereby granted, free of charge, to any person
-%% obtaining a copy of this software and associated documentation
-%% files (the "Software"), to deal in the Software without
-%% restriction, including without limitation the rights to use,
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
-%% copies of the Software, and to permit persons to whom the
-%% Software is furnished to do so, subject to the following
-%% conditions:
-%% 
-%% The above copyright notice and this permission notice shall be
-%% included in all copies or substantial portions of the Software.
-%% 
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-%% OTHER DEALINGS IN THE SOFTWARE.
-%%
-%% @doc Provides test functionality against a specific web request. Many of
-%% the exported methods can be used to build your own more complex tests.
--module(etap_request, [Method, Url, InHeaders, InBody, Status, OutHeaders, OutBody]).
-
--export([status_is/2]).
-
--export([
-    method/0, url/0, status/0, status_code/0, status_line/0, rheaders/0,
-    has_rheader/1, rheader/1, rbody/0, header_is/3, body_is/2,
-    body_has_string/2
-]).
-
-% ---
-% Tests
-
-%% @doc Assert that response status code is the given status code.
-status_is(Code, Desc) ->
-    etap:is(status_code(), Code, Desc).
-
-header_is(Name, Value, Desc) ->
-    etap:is(rheader(Name), Value, Desc).
-
-body_is(Value, Desc) ->
-    etap:is(rbody(), Value, Desc).
-
-body_has_string(String, Desc) when is_list(OutBody), is_list(String) ->
-    etap_string:contains_ok(OutBody, String, Desc).
-
-% ---
-% Accessor functions
-
-%% @doc Access a request's method.
-method() -> Method.
-
-%% @doc Access a request's URL.
-url() -> Url.
-
-%% @doc Access a request's status.
-status() -> Status.
-
-%% @doc Access a request's status code.
-status_code() ->
-    {_, Code, _} = Status,
-    Code.
-
-%% @doc Access a request's status line.
-status_line() ->
-    {_, _, Line} = Status,
-    Line.
-
-%% @doc Access a request's headers.
-rheaders() -> OutHeaders.
-
-%% @doc Dertermine if a specific request header exists.
-has_rheader(Key) ->
-    lists:keymember(Key, 1, OutHeaders).
-
-%% @doc Return a specific request header.
-rheader(Key) ->
-    case lists:keysearch(Key, 1, OutHeaders) of
-        false -> undefined;
-        {value, {Key, Value}} -> Value
-    end.
-
-%% @doc Access the request's body.
-rbody() -> OutBody.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/etap/etap_string.erl
----------------------------------------------------------------------
diff --git a/src/etap/etap_string.erl b/src/etap/etap_string.erl
deleted file mode 100644
index 67aa3d5..0000000
--- a/src/etap/etap_string.erl
+++ /dev/null
@@ -1,47 +0,0 @@
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
-%% 
-%% Permission is hereby granted, free of charge, to any person
-%% obtaining a copy of this software and associated documentation
-%% files (the "Software"), to deal in the Software without
-%% restriction, including without limitation the rights to use,
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
-%% copies of the Software, and to permit persons to whom the
-%% Software is furnished to do so, subject to the following
-%% conditions:
-%% 
-%% The above copyright notice and this permission notice shall be
-%% included in all copies or substantial portions of the Software.
-%% 
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-%% OTHER DEALINGS IN THE SOFTWARE.
-%%
-%% @author Nick Gerakines <nick@gerakines.net> [http://socklabs.com/]
-%% @copyright 2008 Nick Gerakines
-%% @doc Provide testing functionality for strings.
--module(etap_string).
-
--export([contains_ok/3, is_before/4]).
-
-%% @spec contains_ok(string(), string(), string()) -> true | false
-%% @doc Assert that a string is contained in another string.
-contains_ok(Source, String, Desc) ->
-    etap:isnt(
-        string:str(Source, String),
-        0,
-        Desc
-    ).
-
-%% @spec is_before(string(), string(), string(), string()) -> true | false
-%% @doc Assert that a string comes before another string within a larger body.
-is_before(Source, StringA, StringB, Desc) ->
-    etap:is_greater(
-        string:str(Source, StringB),
-        string:str(Source, StringA),
-        Desc
-    ).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/src/etap/etap_web.erl
----------------------------------------------------------------------
diff --git a/src/etap/etap_web.erl b/src/etap/etap_web.erl
deleted file mode 100644
index f97edfd..0000000
--- a/src/etap/etap_web.erl
+++ /dev/null
@@ -1,65 +0,0 @@
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
-%% 
-%% Permission is hereby granted, free of charge, to any person
-%% obtaining a copy of this software and associated documentation
-%% files (the "Software"), to deal in the Software without
-%% restriction, including without limitation the rights to use,
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
-%% copies of the Software, and to permit persons to whom the
-%% Software is furnished to do so, subject to the following
-%% conditions:
-%% 
-%% The above copyright notice and this permission notice shall be
-%% included in all copies or substantial portions of the Software.
-%% 
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-%% OTHER DEALINGS IN THE SOFTWARE.
-%%
-%% @author Nick Gerakines <nick@gerakines.net> [http://socklabs.com/]
-%% @copyright 2008 Nick Gerakines
-%% @todo Support cookies.
-%% @doc Provide testing functionality for web requests.
--module(etap_web).
-
--export([simple_200/2, simple_404/2, build_request/4]).
-
-%% @doc Fetch a url and verify that it returned a 200 status.
-simple_200(Url, Desc) ->
-    Request = build_request(get, Url, [], []),
-    Request:status_is(200, Desc).
-
-%% @doc Fetch a url and verify that it returned a 404 status.
-simple_404(Url, Desc) ->
-    Request = build_request(get, Url, [], []),
-    Request:status_is(404, Desc).
-
-%% @doc Create and return a request structure.
-build_request(Method, Url, Headers, Body) 
- when Method==options;Method==get;Method==head;Method==delete;Method==trace ->
-     try httpc:request(Method, {Url, Headers}, [{autoredirect, false}], []) of
-        {ok, {OutStatus, OutHeaders, OutBody}} ->
-            etap_request:new(Method, Url, Headers, Body, OutStatus, OutHeaders, OutBody);
-        _ -> error
-    catch
-        _:_ -> error
-    end;
-
-%% @doc Create and return a request structure.
-build_request(Method, Url, Headers, Body) when Method == post; Method == put ->
-    ContentType = case lists:keysearch("Content-Type", 1, Headers) of
-        {value, {"Content-Type", X}} -> X;
-        _ -> []
-    end,
-    try httpc:request(Method, {Url, Headers, ContentType, Body}, [{autoredirect, false}], []) of
-        {ok, {OutStatus, OutHeaders, OutBody}} ->
-            etap_request:new(Method, Url, Headers, Body, OutStatus, OutHeaders, OutBody);
-        _ -> error
-    catch
-        _:_ -> error
-    end.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/test/etap/001-load.t
----------------------------------------------------------------------
diff --git a/test/etap/001-load.t b/test/etap/001-load.t
index 8bcfca4..5ce0d93 100755
--- a/test/etap/001-load.t
+++ b/test/etap/001-load.t
@@ -60,7 +60,7 @@ main(_) ->
     etap:plan(length(Modules)),
     lists:foreach(
         fun(Module) ->
-            etap_can:loaded_ok(
+            etap:loaded_ok(
                 Module,
                 lists:concat(["Loaded: ", Module])
             )

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/test/etap/020-btree-basics.t
----------------------------------------------------------------------
diff --git a/test/etap/020-btree-basics.t b/test/etap/020-btree-basics.t
index 6886ee1..b0fb2d2 100755
--- a/test/etap/020-btree-basics.t
+++ b/test/etap/020-btree-basics.t
@@ -235,10 +235,10 @@ test_final_reductions(Btree, KeyValues) ->
     KVLen = FoldLRed + FoldRRed,
     ok.
 
-test_traversal_callbacks(Btree, KeyValues) ->
+test_traversal_callbacks(Btree, _KeyValues) ->
     FoldFun =
     fun
-        (visit, GroupedKey, Unreduced, Acc) ->
+        (visit, _GroupedKey, _Unreduced, Acc) ->
             {ok, Acc andalso false};
         (traverse, _LK, _Red, Acc) ->
             {skip, Acc andalso true}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/test/etap/040-util.t
----------------------------------------------------------------------
diff --git a/test/etap/040-util.t b/test/etap/040-util.t
index 8f80db8..d57a32e 100755
--- a/test/etap/040-util.t
+++ b/test/etap/040-util.t
@@ -53,8 +53,8 @@ test() ->
     etap:ok(not couch_util:should_flush(),
         "Not using enough memory to flush."),
     AcquireMem = fun() ->
-        IntsToAGazillion = lists:seq(1, 200000),
-        LotsOfData = lists:map(
+        _IntsToAGazillion = lists:seq(1, 200000),
+        _LotsOfData = lists:map(
             fun(Int) -> {Int, <<"foobar">>} end,
         lists:seq(1, 500000)),
         etap:ok(couch_util:should_flush(),

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/test/etap/050-stream.t
----------------------------------------------------------------------
diff --git a/test/etap/050-stream.t b/test/etap/050-stream.t
index de0dfad..676f1e4 100755
--- a/test/etap/050-stream.t
+++ b/test/etap/050-stream.t
@@ -68,7 +68,7 @@ test() ->
     % Stream more the 4K chunk size.
     {ok, ExpPtr2} = couch_file:bytes(Fd),
     {ok, Stream3} = couch_stream:open(Fd, [{buffer_size, 4096}]),
-    Acc2 = lists:foldl(fun(_, Acc) ->
+    lists:foldl(fun(_, Acc) ->
         Data = <<"a1b2c">>,
         couch_stream:write(Stream3, Data),
         [Data | Acc]

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/test/etap/072-cleanup.t
----------------------------------------------------------------------
diff --git a/test/etap/072-cleanup.t b/test/etap/072-cleanup.t
index bd420f4..6721090 100755
--- a/test/etap/072-cleanup.t
+++ b/test/etap/072-cleanup.t
@@ -55,7 +55,7 @@ test() ->
     BoozRev = create_design_doc(<<"_design/booz">>, <<"baz">>),
     query_view("booz", "baz"),
 
-    {ok, Db} = couch_db:open(?TEST_DB, [{user_ctx, ?ADMIN_USER}]),
+    {ok, _Db} = couch_db:open(?TEST_DB, [{user_ctx, ?ADMIN_USER}]),
     view_cleanup(),
     etap:is(count_index_files(), 2,
         "Two index files before any deletions."),

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/test/etap/073-changes.t
----------------------------------------------------------------------
diff --git a/test/etap/073-changes.t b/test/etap/073-changes.t
index 97f6860..845cd79 100755
--- a/test/etap/073-changes.t
+++ b/test/etap/073-changes.t
@@ -318,7 +318,7 @@ test_design_docs_only() ->
 test_heartbeat() ->
     {ok, Db} = create_db(test_db_name()),
 
-    {ok, Rev3} = save_doc(Db, {[
+    {ok, _} = save_doc(Db, {[
         {<<"_id">>, <<"_design/foo">>},
         {<<"language">>, <<"javascript">>},
             {<<"filters">>, {[

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/test/etap/083-config-no-files.t
----------------------------------------------------------------------
diff --git a/test/etap/083-config-no-files.t b/test/etap/083-config-no-files.t
index 675feb5..0ce38e6 100755
--- a/test/etap/083-config-no-files.t
+++ b/test/etap/083-config-no-files.t
@@ -13,8 +13,6 @@
 % License for the specific language governing permissions and limitations under
 % the License.
 
-default_config() ->
-    test_util:build_file("etc/couchdb/default_dev.ini").
 
 main(_) ->
     test_util:init_code_path(),

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb3d5d8b/test/etap/090-task-status.t
----------------------------------------------------------------------
diff --git a/test/etap/090-task-status.t b/test/etap/090-task-status.t
index 3485583..23115bd 100755
--- a/test/etap/090-task-status.t
+++ b/test/etap/090-task-status.t
@@ -46,9 +46,6 @@ get_task_prop(Pid, Prop) ->
         Value
     end.
 
-now_ts() ->
-    {Mega, Secs, _} = erlang:now(),
-    Mega * 1000000 + Secs.
 
 loop() ->
     receive


Mime
View raw message