summaryrefslogtreecommitdiff
path: root/src/rebar_prv_common_test.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2016-04-07 11:19:40 -0400
committerFred Hebert <mononcqc@ferd.ca>2016-04-07 11:19:40 -0400
commit0ad1113592fa19ac7c1b11cf1dce58eb31c23074 (patch)
tree58a2356b9c5d49ddc834b48d4f7e5df5fb9973f6 /src/rebar_prv_common_test.erl
parente88aec9d32380787bd55fd46f2d16a63e3c7c690 (diff)
parentf420ccab9831fe6180f1a4dc3fa098ffbc01a40c (diff)
Merge pull request #1152 from soranoba/feature/test-distnode
supported dist_node in ct and eunit
Diffstat (limited to 'src/rebar_prv_common_test.erl')
-rw-r--r--src/rebar_prv_common_test.erl16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl
index 14dc4cc..5712fbf 100644
--- a/src/rebar_prv_common_test.erl
+++ b/src/rebar_prv_common_test.erl
@@ -37,6 +37,7 @@ init(State) ->
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
+ setup_name(State),
Tests = prepare_tests(State),
case compile(State, Tests) of
%% successfully compiled apps
@@ -105,6 +106,10 @@ format_error({multiple_errors, Errors}) ->
%% Internal functions
%% ===================================================================
+setup_name(State) ->
+ {Long, Short, Opts} = rebar_dist_utils:find_options(State),
+ rebar_dist_utils:either(Long, Short, Opts).
+
prepare_tests(State) ->
%% command line test options
CmdOpts = cmdopts(State),
@@ -639,7 +644,10 @@ ct_opts(_State) ->
{create_priv_dir, undefined, "create_priv_dir", string, help(create_priv_dir)},
{include, undefined, "include", string, help(include)},
{readable, undefined, "readable", boolean, help(readable)},
- {verbose, $v, "verbose", boolean, help(verbose)}
+ {verbose, $v, "verbose", boolean, help(verbose)},
+ {name, undefined, "name", atom, help(name)},
+ {sname, undefined, "sname", atom, help(sname)},
+ {setcookie, undefined, "setcookie", atom, help(setcookie)}
].
help(dir) ->
@@ -694,5 +702,11 @@ help(readable) ->
"Shows test case names and only displays logs to shell on failures";
help(verbose) ->
"Verbose output";
+help(name) ->
+ "Gives a long name to the node";
+help(sname) ->
+ "Gives a short name to the node";
+help(setcookie) ->
+ "Sets the cookie if the node is distributed";
help(_) ->
"".