summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvarnerac-ubnt <drew.varner@ubnt.com>2014-06-27 12:26:25 -0500
committervarnerac-ubnt <drew.varner@ubnt.com>2014-06-27 15:35:56 -0500
commit35ee4571760ec7bd3bad9741d982699798bee1dc (patch)
tree71af55c8230fa770a400c6b18fbd67af74b9236c /src
parent6e24cd6ac7f8ba9b125c4898e29fa1e9a207f7d2 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/rebar_ct.erl22
1 files changed, 12 insertions, 10 deletions
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