summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Rascão <luis.rascao@gmail.com>2017-08-21 15:24:40 +0100
committerGitHub <noreply@github.com>2017-08-21 15:24:40 +0100
commit8076675fef6c7a4564392c522ab4170c24fdc067 (patch)
treeb0d611a7d5149ddfcd15045a37ac73807b77debc
parent8b983d42eb6be9aa1cfc9f808d6a0142abad79b1 (diff)
parent0eb9ba8d771a2369d324427c57ad675cc7c5731a (diff)
downloadrebar-8076675fef6c7a4564392c522ab4170c24fdc067.tar.gz
Merge pull request #643 from tuncer/revert-637-drop-crypto-dep
Revert "Drop crypto app reliance"
-rw-r--r--ebin/rebar.app1
-rw-r--r--rebar.config3
-rw-r--r--src/rebar.erl6
-rw-r--r--src/rebar_ct.erl12
-rw-r--r--src/rebar_eunit.erl2
5 files changed, 12 insertions, 12 deletions
diff --git a/ebin/rebar.app b/ebin/rebar.app
index b4c8b5a..9449e1e 100644
--- a/ebin/rebar.app
+++ b/ebin/rebar.app
@@ -55,6 +55,7 @@
stdlib,
sasl,
compiler,
+ crypto,
syntax_tools,
tools,
eunit,
diff --git a/rebar.config b/rebar.config
index 6765415..eda5a2c 100644
--- a/rebar.config
+++ b/rebar.config
@@ -32,8 +32,7 @@
- (\"diameter_dict_util\":\"parse\"/\"2\")
- (\"erlang\":\"timestamp\"/\"0\")
- (\"rebar_rnd\":\"seed\"/\"1\")
- - (\"rebar_rnd\":\"uniform\"/\"0\")
- - (\"rebar_rnd\":\"uniform\"/\"1\"))",
+ - (\"rebar_rnd\":\"uniform\"/\"0\"))",
[]}]}.
{dialyzer,
diff --git a/src/rebar.erl b/src/rebar.erl
index c87e591..d35e492 100644
--- a/src/rebar.erl
+++ b/src/rebar.erl
@@ -205,6 +205,12 @@ profile(_Config, _Commands, Profiler) ->
?ABORT("Unsupported profiler: ~s~n", [Profiler]).
run_aux(BaseConfig, Commands) ->
+ %% Make sure crypto is running
+ case crypto:start() of
+ ok -> ok;
+ {error,{already_started,crypto}} -> ok
+ end,
+
%% Make sure memoization server is running
case rmemo:start() of
{ok, _} -> ok;
diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl
index 892ae03..b27f661 100644
--- a/src/rebar_ct.erl
+++ b/src/rebar_ct.erl
@@ -237,7 +237,6 @@ make_cmd(TestDir, RawLogDir, Config) ->
CodeDirs = [io_lib:format("\"~s\"", [Dir]) ||
Dir <- [EbinDir|NonLibCodeDirs]],
CodePathString = string:join(CodeDirs, " "),
- _ = rebar_rnd:seed({55, seconds(), 7331}),
Cmd = case get_ct_specs(Config, search_ct_specs_from(Cwd, TestDir, Config)) of
undefined ->
?FMT("~s"
@@ -286,18 +285,13 @@ search_ct_specs_from(Cwd, TestDir, Config) ->
Cwd
end.
-seconds() ->
- calendar:datetime_to_gregorian_seconds(calendar:universal_time()).
-
build_name(Config) ->
%% generate a unique name for our test node, we want
%% to make sure the odds of name clashing are low
- Secs = integer_to_list(seconds()),
- Random = integer_to_list(rebar_rnd:uniform(1000000)),
- PseudoUnique = Random ++ "N" ++ Secs,
+ Random = integer_to_list(crypto:rand_uniform(0, 10000)),
case rebar_config:get_local(Config, ct_use_short_names, false) of
- true -> "-sname test" ++ PseudoUnique;
- false -> " -name test" ++ PseudoUnique ++ "@" ++ net_adm:localhost()
+ true -> "-sname test" ++ Random;
+ false -> " -name test" ++ Random ++ "@" ++ net_adm:localhost()
end.
get_extra_params(Config) ->
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index 538f88b..ebf76bc 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -279,7 +279,7 @@ randomize_suites(Config, Modules) ->
undefined ->
Modules;
"true" ->
- Seed = rebar_rnd:uniform(65535),
+ Seed = crypto:rand_uniform(1, 65535),
randomize_suites1(Modules, Seed);
String ->
try list_to_integer(String) of