Browse Source

Some fixes after review

pull/489/head
Viacheslav V. Kovalev 10 years ago
parent
commit
44272e23b6
3 changed files with 7 additions and 7 deletions
  1. +1
    -2
      src/rebar_prv_dialyzer.erl
  2. +2
    -1
      test/rebar_test_utils.erl
  3. +4
    -4
      test/rebar_utils_SUITE.erl

+ 1
- 2
src/rebar_prv_dialyzer.erl View File

@ -97,8 +97,7 @@ do(State) ->
%% Dialyzer gets default plt location wrong way by peeking HOME environment %% Dialyzer gets default plt location wrong way by peeking HOME environment
%% variable which usually is not defined on Windows. %% variable which usually is not defined on Windows.
maybe_fix_env() -> maybe_fix_env() ->
{ok, [[HomePath]]} = init:get_argument(home),
os:putenv("DIALYZER_PLT", filename:join(HomePath, ".dialyzer_plt")).
os:putenv("DIALYZER_PLT", filename:join(rebar_dir:home_dir(), ".dialyzer_plt")).
-spec format_error(any()) -> iolist(). -spec format_error(any()) -> iolist().
format_error({error_processing_apps, Error}) -> format_error({error_processing_apps, Error}) ->

+ 2
- 1
test/rebar_test_utils.erl View File

@ -105,7 +105,8 @@ create_config(AppDir, Contents) ->
%% @doc Util to create a random variation of a given name. %% @doc Util to create a random variation of a given name.
create_random_name(Name) -> create_random_name(Name) ->
random:seed(erlang:now()),
<<A:32, B:32, C:32>> = crypto:rand_bytes(12),
random:seed({A,B,C}),
Name ++ erlang:integer_to_list(random:uniform(1000000)). Name ++ erlang:integer_to_list(random:uniform(1000000)).
%% @doc Util to create a random variation of a given version. %% @doc Util to create a random variation of a given version.

+ 4
- 4
test/rebar_utils_SUITE.erl View File

@ -22,7 +22,7 @@
task_with_flag_with_commas/1, task_with_flag_with_commas/1,
task_with_multiple_flags/1, task_with_multiple_flags/1,
special_task_do/1, special_task_do/1,
sh_don_not_miss_messages/1]).
sh_does_not_miss_messages/1]).
-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
@ -31,7 +31,7 @@
all() -> all() ->
[{group, args_to_tasks}, [{group, args_to_tasks},
sh_don_not_miss_messages].
sh_does_not_miss_messages].
groups() -> groups() ->
[{args_to_tasks, [], [empty_arglist, [{args_to_tasks, [], [empty_arglist,
@ -120,7 +120,7 @@ special_task_do(_Config) ->
"do", "do",
"bar,", "bar,",
"baz"]). "baz"]).
sh_don_not_miss_messages(_Config) ->
sh_does_not_miss_messages(_Config) ->
Source = "~nmain(_) ->~n io:format(\"donotmissme\").~n", Source = "~nmain(_) ->~n io:format(\"donotmissme\").~n",
file:write_file("do_not_miss_messages", io_lib:format(Source,[])), file:write_file("do_not_miss_messages", io_lib:format(Source,[])),
{ok, "donotmissme"} = rebar_utils:sh("escript do_not_miss_messages", []), {ok, "donotmissme"} = rebar_utils:sh("escript do_not_miss_messages", []),
@ -130,4 +130,4 @@ sh_don_not_miss_messages(_Config) ->
after 100 -> after 100 ->
false false
end, end,
AnyMessageRemained = false.
AnyMessageRemained = false.

Loading…
Cancel
Save