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 0774C178EA for ; Mon, 1 Jun 2015 20:41:57 +0000 (UTC) Received: (qmail 61571 invoked by uid 500); 1 Jun 2015 20:41:56 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 61227 invoked by uid 500); 1 Jun 2015 20:41: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 59635 invoked by uid 99); 1 Jun 2015 20:41:55 -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; Mon, 01 Jun 2015 20:41:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A4433E08BE; Mon, 1 Jun 2015 20:41:55 +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: Mon, 01 Jun 2015 20:42:20 -0000 Message-Id: <022e6d56e5004319a855d7262b33eda4@git.apache.org> In-Reply-To: <78c80ee93a184cf38737dfceafa81356@git.apache.org> References: <78c80ee93a184cf38737dfceafa81356@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [26/50] rebar commit: updated refs/heads/import to e9f62c4 Fix bug 271 Moves ct_extra_params to the end of the generated ct_run command. This allows users to pass commands to the underlying emulator using -erl_args. The included rt test demonstrates that it is possible to pass an addtional option to ct_run and -erl_args at the same time. Finally, the test executes in regular and verbose modes because rebar constructs the ct_run command differently in verbose mode. Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/35ee4571 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/35ee4571 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/35ee4571 Branch: refs/heads/import Commit: 35ee4571760ec7bd3bad9741d982699798bee1dc Parents: 6e24cd6 Author: varnerac-ubnt Authored: Fri Jun 27 12:26:25 2014 -0500 Committer: varnerac-ubnt Committed: Fri Jun 27 15:35:56 2014 -0500 ---------------------------------------------------------------------- THANKS | 1 + inttest/ct1/app.config | 2 ++ inttest/ct1/ct1_rt.erl | 2 ++ inttest/ct1/rebar.config | 1 + inttest/ct1/test_SUITE.erl | 8 +++++++- src/rebar_ct.erl | 22 ++++++++++++---------- 6 files changed, 25 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/35ee4571/THANKS ---------------------------------------------------------------------- diff --git a/THANKS b/THANKS index 95cc493..6bf2ea0 100644 --- a/THANKS +++ b/THANKS @@ -120,3 +120,4 @@ Pedram Nimreezi Sylvain Benner Oliver Ferrigni Dave Thomas +Drew Varner http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/35ee4571/inttest/ct1/app.config ---------------------------------------------------------------------- diff --git a/inttest/ct1/app.config b/inttest/ct1/app.config new file mode 100644 index 0000000..bb718b2 --- /dev/null +++ b/inttest/ct1/app.config @@ -0,0 +1,2 @@ +%% This file is an application config file, not a CT test config file +[{a1, [{foo, bar}]}]. http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/35ee4571/inttest/ct1/ct1_rt.erl ---------------------------------------------------------------------- diff --git a/inttest/ct1/ct1_rt.erl b/inttest/ct1/ct1_rt.erl index f173d3f..f9de372 100644 --- a/inttest/ct1/ct1_rt.erl +++ b/inttest/ct1/ct1_rt.erl @@ -7,10 +7,12 @@ files() -> [{create, "ebin/a1.app", app(a1)}, {copy, "../../rebar", "rebar"}, {copy, "rebar.config", "rebar.config"}, + {copy, "app.config", "app.config"}, {copy, "test_SUITE.erl", "itest/test_SUITE.erl"}]. run(_Dir) -> {ok, _} = retest:sh("./rebar compile ct"), + {ok, _} = retest:sh("./rebar compile ct -v"), ok. http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/35ee4571/inttest/ct1/rebar.config ---------------------------------------------------------------------- diff --git a/inttest/ct1/rebar.config b/inttest/ct1/rebar.config index a4b5284..58047ba 100644 --- a/inttest/ct1/rebar.config +++ b/inttest/ct1/rebar.config @@ -1 +1,2 @@ {ct_dir, "itest"}. +{ct_extra_params, "-repeat 2 -erl_args -config app"}. http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/35ee4571/inttest/ct1/test_SUITE.erl ---------------------------------------------------------------------- diff --git a/inttest/ct1/test_SUITE.erl b/inttest/ct1/test_SUITE.erl index 92f2b2e..e8a2bb8 100644 --- a/inttest/ct1/test_SUITE.erl +++ b/inttest/ct1/test_SUITE.erl @@ -5,7 +5,13 @@ -include_lib("ct.hrl"). all() -> - [simple_test]. + [simple_test, + app_config_file_test]. simple_test(Config) -> io:format("Test: ~p\n", [Config]). + +app_config_file_test(_Config) -> + application:start(a1), + {ok, bar} = application:get_env(a1, foo), + application:stop(a1). http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/35ee4571/src/rebar_ct.erl ---------------------------------------------------------------------- diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl index f3ed29f..c2b54a1 100644 --- a/src/rebar_ct.erl +++ b/src/rebar_ct.erl @@ -217,15 +217,13 @@ make_cmd(TestDir, RawLogDir, Config) -> " ~s" " ~s" " -logdir \"~s\"" - " -env TEST_DIR \"~s\"" - " ~s", + " -env TEST_DIR \"~s\"", [BaseCmd, CodePathString, Include, build_name(Config), LogDir, - filename:join(Cwd, TestDir), - get_extra_params(Config)]) ++ + filename:join(Cwd, TestDir)]) ++ get_cover_config(Config, Cwd) ++ get_ct_config_file(TestDir) ++ get_config_file(TestDir) ++ @@ -237,19 +235,18 @@ make_cmd(TestDir, RawLogDir, Config) -> " ~s" " ~s" " -logdir \"~s\"" - " -env TEST_DIR \"~s\"" - " ~s", + " -env TEST_DIR \"~s\"", [BaseCmd, CodePathString, Include, build_name(Config), LogDir, - filename:join(Cwd, TestDir), - get_extra_params(Config)]) ++ + filename:join(Cwd, TestDir)]) ++ SpecFlags ++ get_cover_config(Config, Cwd) end, + Cmd1 = Cmd ++ get_extra_params(Config), RawLog = filename:join(LogDir, "raw.log"), - {Cmd, RawLog}. + {Cmd1, RawLog}. build_name(Config) -> case rebar_config:get_local(Config, ct_use_short_names, false) of @@ -258,7 +255,12 @@ build_name(Config) -> end. get_extra_params(Config) -> - rebar_config:get_local(Config, ct_extra_params, ""). + case rebar_config:get_local(Config, ct_extra_params, undefined) of + undefined -> + ""; + Defined -> + " " ++ Defined + end. get_ct_specs(Cwd) -> case collect_glob(Cwd, ".*\.test\.spec\$") of