summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav V. Kovalev <kovyl2404@gmail.com>2015-06-28 00:20:26 +0300
committerViacheslav V. Kovalev <kovyl2404@gmail.com>2015-06-28 00:20:26 +0300
commit99858f3b6902c4feb95620ce0125c52635bf8f00 (patch)
tree01ef2aab9e6e502394790000ed224060c441339e
parentb2711335aafde6c7bf861a26011568e93667c6d8 (diff)
Use same random seeding function for random_name and random_vsn
-rw-r--r--test/rebar_test_utils.erl11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/rebar_test_utils.erl b/test/rebar_test_utils.erl
index 0c65cb2..4943d4b 100644
--- a/test/rebar_test_utils.erl
+++ b/test/rebar_test_utils.erl
@@ -105,17 +105,22 @@ create_config(AppDir, Contents) ->
%% @doc Util to create a random variation of a given name.
create_random_name(Name) ->
- <<A:32, B:32, C:32>> = crypto:rand_bytes(12),
- random:seed({A,B,C}),
+ random_seed(),
Name ++ erlang:integer_to_list(random:uniform(1000000)).
%% @doc Util to create a random variation of a given version.
create_random_vsn() ->
- random:seed(erlang:now()),
+ random_seed(),
lists:flatten([erlang:integer_to_list(random:uniform(100)),
".", erlang:integer_to_list(random:uniform(100)),
".", erlang:integer_to_list(random:uniform(100))]).
+random_seed() ->
+ <<A:32, B:32, C:32>> = crypto:rand_bytes(12),
+ random:seed({A,B,C}).
+
+
+
expand_deps(_, []) -> [];
expand_deps(git, [{Name, Deps} | Rest]) ->
Dep = {Name, ".*", {git, "https://example.org/user/"++Name++".git", "master"}},