couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject [44/50] [abbrv] couch commit: updated refs/heads/1963-eunit-bigcouch to 95bfc03
Date Fri, 15 Aug 2014 20:25:11 GMT
WIP: add couch_eunit.hrl


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

Branch: refs/heads/1963-eunit-bigcouch
Commit: 95bfc0360eddaddfe82061fa66c2189f1e260bc5
Parents: 6179af6
Author: Russell Branca <chewbranca@apache.org>
Authored: Fri Aug 15 13:12:06 2014 -0700
Committer: Russell Branca <chewbranca@apache.org>
Committed: Fri Aug 15 13:24:06 2014 -0700

----------------------------------------------------------------------
 include/couch_eunit.hrl | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/95bfc036/include/couch_eunit.hrl
----------------------------------------------------------------------
diff --git a/include/couch_eunit.hrl b/include/couch_eunit.hrl
new file mode 100644
index 0000000..83e0d68
--- /dev/null
+++ b/include/couch_eunit.hrl
@@ -0,0 +1,44 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-include_lib("eunit/include/eunit.hrl").
+
+-define(BUILDDIR, "/Users/russell/src/couchdb").
+-define(SOURCEDIR, "/Users/russell/src/couchdb/src/couch").
+-define(CONFIG_CHAIN, [
+    filename:join([?BUILDDIR, "etc", "couchdb", "default_dev.ini"]),
+    filename:join([?BUILDDIR, "etc", "couchdb", "local_dev.ini"]),
+    filename:join([?BUILDDIR, "etc", "couchdb", "eunit.ini"])]).
+-define(FIXTURESDIR,
+    filename:join([?SOURCEDIR, "test", "fixtures"])).
+-define(TEMPDIR,
+    filename:join([?BUILDDIR, "test", "temp"])).
+
+-define(tempfile,
+    fun() ->
+        {A, B, C} = erlang:now(),
+        N = node(),
+        FileName = lists:flatten(io_lib:format("~p-~p.~p.~p", [N, A, B, C])),
+        filename:join([?TEMPDIR, FileName])
+    end).
+-define(tempdb,
+    fun() ->
+            Nums = tuple_to_list(erlang:now()),
+            Prefix = "eunit-test-db",
+            Suffix = lists:concat([integer_to_list(Num) || Num <- Nums]),
+            list_to_binary(Prefix ++ "-" ++ Suffix)
+    end).
+-define(docid,
+    fun() ->
+        {A, B, C} = erlang:now(),
+        lists:flatten(io_lib:format("~p~p~p", [A, B, C]))
+    end).


Mime
View raw message