summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Watson <watson.timothy@gmail.com>2011-04-06 17:47:29 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-04-06 20:11:13 +0200
commit2d385970bf3d1d0b153b9a324c524eb7a78c514a (patch)
treefa74189ec76dc6462dd8a9b48c4e47427d272f5f
parent9c0ed1057a57ca2fbe29219dcec690a6702ae743 (diff)
Pass extra params to ct (thanks Mickael Remond)
This patch adds a `ct_extra_params` option to rebar.config, the value of which is appended to the shell command when executing common test.
-rw-r--r--rebar.config.sample5
-rw-r--r--src/rebar_ct.erl19
2 files changed, 18 insertions, 6 deletions
diff --git a/rebar.config.sample b/rebar.config.sample
index 61919ca..8b9a90f 100644
--- a/rebar.config.sample
+++ b/rebar.config.sample
@@ -75,6 +75,11 @@
%% Whether to print coverage report to console. Default is `false'
{cover_print_enabled, false}.
+%% == Common Test ==
+
+%% Option to pass extra parameters when launching Common Test
+{ct_extra_params, "-boot start_sasl -s myapp"}.
+
%% == Dialyzer ==
%% Options for running dialyzer
diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl
index 1e05198..7ce6142 100644
--- a/src/rebar_ct.erl
+++ b/src/rebar_ct.erl
@@ -145,15 +145,17 @@ make_cmd(TestDir, Config) ->
undefined ->
?FMT("erl " % should we expand ERL_PATH?
" -noshell -pa ~s ~s"
- " -s ct_run script_start -s erlang halt"
" -name test@~s"
" -logdir \"~s\""
- " -env TEST_DIR \"~s\"",
+ " -env TEST_DIR \"~s\""
+ " ~s"
+ " -s ct_run script_start -s erlang halt",
[CodePathString,
Include,
net_adm:localhost(),
LogDir,
- filename:join(Cwd, TestDir)]) ++
+ filename:join(Cwd, TestDir),
+ get_extra_params(Config)]) ++
get_cover_config(Config, Cwd) ++
get_ct_config_file(TestDir) ++
get_config_file(TestDir) ++
@@ -162,20 +164,25 @@ make_cmd(TestDir, Config) ->
SpecFlags ->
?FMT("erl " % should we expand ERL_PATH?
" -noshell -pa ~s ~s"
- " -s ct_run script_start -s erlang halt"
" -name test@~s"
" -logdir \"~s\""
- " -env TEST_DIR \"~s\"",
+ " -env TEST_DIR \"~s\""
+ " ~s"
+ " -s ct_run script_start -s erlang halt",
[CodePathString,
Include,
net_adm:localhost(),
LogDir,
- filename:join(Cwd, TestDir)]) ++
+ filename:join(Cwd, TestDir),
+ get_extra_params(Config)]) ++
SpecFlags ++ get_cover_config(Config, Cwd)
end,
RawLog = filename:join(LogDir, "raw.log"),
{Cmd, RawLog}.
+get_extra_params(Config) ->
+ rebar_config:get_local(Config, ct_extra_params, "").
+
get_ct_specs(Cwd) ->
case collect_glob(Cwd, ".*\.test\.spec\$") of
[] -> undefined;