Skip to content

Commit

Permalink
Merge pull request apache#643 from tuncer/revert-637-drop-crypto-dep
Browse files Browse the repository at this point in the history
Revert "Drop crypto app reliance"
  • Loading branch information
lrascao committed Aug 21, 2017
2 parents 8b983d4 + 0eb9ba8 commit 8076675
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
1 change: 1 addition & 0 deletions ebin/rebar.app
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
stdlib,
sasl,
compiler,
crypto,
syntax_tools,
tools,
eunit,
Expand Down
3 changes: 1 addition & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions src/rebar.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 3 additions & 9 deletions src/rebar_ct.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) ->
Expand Down
2 changes: 1 addition & 1 deletion src/rebar_eunit.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8076675

Please sign in to comment.