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 4F61711741 for ; Thu, 28 Aug 2014 17:35:01 +0000 (UTC) Received: (qmail 39495 invoked by uid 500); 28 Aug 2014 17:34:58 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 39378 invoked by uid 500); 28 Aug 2014 17:34:58 -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 38454 invoked by uid 99); 28 Aug 2014 17:34:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Aug 2014 17:34:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B1054A04BCA; Thu, 28 Aug 2014 17:34:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chewbranca@apache.org To: commits@couchdb.apache.org Date: Thu, 28 Aug 2014 17:35:36 -0000 Message-Id: In-Reply-To: <3b2f70a7334d4c93af17616b11bbac06@git.apache.org> References: <3b2f70a7334d4c93af17616b11bbac06@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [41/50] [abbrv] couch commit: updated refs/heads/1963-eunit-bigcouch to 3ecd0a0 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/6f43f83c Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/6f43f83c Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/6f43f83c Branch: refs/heads/1963-eunit-bigcouch Commit: 6f43f83c989eefebe76af1595d2996bbf5f8c4ab Parents: c8f1f49 Author: Russell Branca Authored: Fri Aug 15 13:12:06 2014 -0700 Committer: Russell Branca Committed: Thu Aug 28 10:34:30 2014 -0700 ---------------------------------------------------------------------- include/couch_eunit.hrl | 54 ++++++++++++++++++++++++++++ test/couch_auth_cache_tests.erl | 1 - test/couch_changes_tests.erl | 1 - test/couchdb_compaction_daemon.erl | 1 - test/couchdb_cors_tests.erl | 1 - test/couchdb_file_compression_tests.erl | 1 - test/couchdb_update_conflicts_tests.erl | 1 - test/couchdb_vhosts_tests.erl | 1 - test/couchdb_views_tests.erl | 1 - 9 files changed, 54 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/6f43f83c/include/couch_eunit.hrl ---------------------------------------------------------------------- diff --git a/include/couch_eunit.hrl b/include/couch_eunit.hrl new file mode 100644 index 0000000..d6d7278 --- /dev/null +++ b/include/couch_eunit.hrl @@ -0,0 +1,54 @@ +% 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(ADMIN_ROLE, #user_ctx{roles=[<<"_admin">>]}). +-define(ADMIN_USER, {user_ctx, ?ADMIN_ROLE}). + +-define(BUILDDIR, + fun() -> + case os:getenv("BUILDDIR") of + false -> + throw("BUILDDIR environment variable must be set"); + Dir -> + Dir + end + end). +-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([?BUILDDIR(), "src", "couch", "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). http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/6f43f83c/test/couch_auth_cache_tests.erl ---------------------------------------------------------------------- diff --git a/test/couch_auth_cache_tests.erl b/test/couch_auth_cache_tests.erl index 83531ff..afad552 100644 --- a/test/couch_auth_cache_tests.erl +++ b/test/couch_auth_cache_tests.erl @@ -15,7 +15,6 @@ -include_lib("couch/include/couch_eunit.hrl"). -include_lib("couch/include/couch_db.hrl"). --define(ADMIN_USER, {user_ctx, #user_ctx{roles=[<<"_admin">>]}}). -define(SALT, <<"SALT">>). -define(TIMEOUT, 1000). http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/6f43f83c/test/couch_changes_tests.erl ---------------------------------------------------------------------- diff --git a/test/couch_changes_tests.erl b/test/couch_changes_tests.erl index 3ae1b52..64754fa 100644 --- a/test/couch_changes_tests.erl +++ b/test/couch_changes_tests.erl @@ -15,7 +15,6 @@ -include_lib("couch/include/couch_eunit.hrl"). -include_lib("couch/include/couch_db.hrl"). --define(ADMIN_USER, {user_ctx, #user_ctx{roles = [<<"_admin">>]}}). -define(TIMEOUT, 3000). -define(TEST_TIMEOUT, 10000). http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/6f43f83c/test/couchdb_compaction_daemon.erl ---------------------------------------------------------------------- diff --git a/test/couchdb_compaction_daemon.erl b/test/couchdb_compaction_daemon.erl index 24c5d7b..0d2195b 100644 --- a/test/couchdb_compaction_daemon.erl +++ b/test/couchdb_compaction_daemon.erl @@ -15,7 +15,6 @@ -include_lib("couch/include/couch_eunit.hrl"). -include_lib("couch/include/couch_db.hrl"). --define(ADMIN_USER, {user_ctx, #user_ctx{roles=[<<"_admin">>]}}). -define(DELAY, 100). -define(TIMEOUT, 30000). -define(TIMEOUT_S, ?TIMEOUT div 1000). http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/6f43f83c/test/couchdb_cors_tests.erl ---------------------------------------------------------------------- diff --git a/test/couchdb_cors_tests.erl b/test/couchdb_cors_tests.erl index 52d1797..cfdbd63 100644 --- a/test/couchdb_cors_tests.erl +++ b/test/couchdb_cors_tests.erl @@ -16,7 +16,6 @@ -include_lib("couch/include/couch_db.hrl"). --define(ADMIN_USER, {user_ctx, #user_ctx{roles=[<<"_admin">>]}}). -define(SUPPORTED_METHODS, "GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT, COPY, OPTIONS"). -define(TIMEOUT, 1000). http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/6f43f83c/test/couchdb_file_compression_tests.erl ---------------------------------------------------------------------- diff --git a/test/couchdb_file_compression_tests.erl b/test/couchdb_file_compression_tests.erl index 5b12882..8f590b9 100644 --- a/test/couchdb_file_compression_tests.erl +++ b/test/couchdb_file_compression_tests.erl @@ -15,7 +15,6 @@ -include_lib("couch/include/couch_eunit.hrl"). -include_lib("couch/include/couch_db.hrl"). --define(ADMIN_USER, {user_ctx, #user_ctx{roles=[<<"_admin">>]}}). -define(DDOC_ID, <<"_design/test">>). -define(DOCS_COUNT, 5000). -define(TIMEOUT, 30000). http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/6f43f83c/test/couchdb_update_conflicts_tests.erl ---------------------------------------------------------------------- diff --git a/test/couchdb_update_conflicts_tests.erl b/test/couchdb_update_conflicts_tests.erl index 7ac1187..58d6014 100644 --- a/test/couchdb_update_conflicts_tests.erl +++ b/test/couchdb_update_conflicts_tests.erl @@ -16,7 +16,6 @@ -include_lib("couch/include/couch_db.hrl"). -define(i2l(I), integer_to_list(I)). --define(ADMIN_USER, {userctx, #user_ctx{roles=[<<"_admin">>]}}). -define(DOC_ID, <<"foobar">>). -define(NUM_CLIENTS, [100, 500, 1000, 2000, 5000, 10000]). -define(TIMEOUT, 10000). http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/6f43f83c/test/couchdb_vhosts_tests.erl ---------------------------------------------------------------------- diff --git a/test/couchdb_vhosts_tests.erl b/test/couchdb_vhosts_tests.erl index 321012f..5eb266c 100644 --- a/test/couchdb_vhosts_tests.erl +++ b/test/couchdb_vhosts_tests.erl @@ -15,7 +15,6 @@ -include_lib("couch/include/couch_eunit.hrl"). -include_lib("couch/include/couch_db.hrl"). --define(ADMIN_USER, {user_ctx, #user_ctx{roles=[<<"_admin">>]}}). -define(TIMEOUT, 1000). -define(iofmt(S, A), lists:flatten(io_lib:format(S, A))). http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/6f43f83c/test/couchdb_views_tests.erl ---------------------------------------------------------------------- diff --git a/test/couchdb_views_tests.erl b/test/couchdb_views_tests.erl index 03fb9cc..012d12e 100644 --- a/test/couchdb_views_tests.erl +++ b/test/couchdb_views_tests.erl @@ -16,7 +16,6 @@ -include_lib("couch/include/couch_db.hrl"). -include_lib("couch_mrview/include/couch_mrview.hrl"). --define(ADMIN_USER, {user_ctx, #user_ctx{roles=[<<"_admin">>]}}). -define(DELAY, 100). -define(TIMEOUT, 1000).