diff options
-rw-r--r-- | ebin/rebar.app | 1 | ||||
-rw-r--r-- | rebar.config | 3 | ||||
-rw-r--r-- | src/rebar.erl | 9 | ||||
-rw-r--r-- | src/rebar_ct.erl | 12 | ||||
-rw-r--r-- | src/rebar_eunit.erl | 2 |
5 files changed, 12 insertions, 15 deletions
diff --git a/ebin/rebar.app b/ebin/rebar.app index 9449e1e..b4c8b5a 100644 --- a/ebin/rebar.app +++ b/ebin/rebar.app @@ -55,7 +55,6 @@ stdlib, sasl, compiler, - crypto, syntax_tools, tools, eunit, diff --git a/rebar.config b/rebar.config index eda5a2c..6765415 100644 --- a/rebar.config +++ b/rebar.config @@ -32,7 +32,8 @@ - (\"diameter_dict_util\":\"parse\"/\"2\") - (\"erlang\":\"timestamp\"/\"0\") - (\"rebar_rnd\":\"seed\"/\"1\") - - (\"rebar_rnd\":\"uniform\"/\"0\"))", + - (\"rebar_rnd\":\"uniform\"/\"0\") + - (\"rebar_rnd\":\"uniform\"/\"1\"))", []}]}. {dialyzer, diff --git a/src/rebar.erl b/src/rebar.erl index 6f78fe6..c87e591 100644 --- a/src/rebar.erl +++ b/src/rebar.erl @@ -156,9 +156,6 @@ init_config1(BaseConfig) -> rebar_config:set_xconf(BaseConfig1, base_dir, AbsCwd). profile(BaseConfig1, Commands) -> - ?CONSOLE("Please take note that profiler=[fprof|eflame] is preliminary" - " and will be~nreplaced with a different command line flag" - " in the next release.~n", []), Profiler = rebar_config:get_global(BaseConfig1, profiler, "fprof"), profile(BaseConfig1, Commands, list_to_atom(Profiler)). @@ -208,12 +205,6 @@ 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 b27f661..892ae03 100644 --- a/src/rebar_ct.erl +++ b/src/rebar_ct.erl @@ -237,6 +237,7 @@ 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" @@ -285,13 +286,18 @@ 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 - Random = integer_to_list(crypto:rand_uniform(0, 10000)), + Secs = integer_to_list(seconds()), + Random = integer_to_list(rebar_rnd:uniform(1000000)), + PseudoUnique = Random ++ "N" ++ Secs, case rebar_config:get_local(Config, ct_use_short_names, false) of - true -> "-sname test" ++ Random; - false -> " -name test" ++ Random ++ "@" ++ net_adm:localhost() + true -> "-sname test" ++ PseudoUnique; + false -> " -name test" ++ PseudoUnique ++ "@" ++ net_adm:localhost() end. get_extra_params(Config) -> diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl index ebf76bc..538f88b 100644 --- a/src/rebar_eunit.erl +++ b/src/rebar_eunit.erl @@ -279,7 +279,7 @@ randomize_suites(Config, Modules) -> undefined -> Modules; "true" -> - Seed = crypto:rand_uniform(1, 65535), + Seed = rebar_rnd:uniform(65535), randomize_suites1(Modules, Seed); String -> try list_to_integer(String) of |