25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Fix Elixir tests failure detection

We now make sure we have no failure.
Solves #438
This commit is contained in:
Mickaël Rémond 2015-03-07 11:49:37 +01:00
parent 8cf4ef0aac
commit da468db648
2 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,6 @@
%%%------------------------------------------------------------------- %%%-------------------------------------------------------------------
%%% @author Evgeniy Khramtsov <ekhramtsov@process-one.net> %%% @author Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%% @copyright (C) 2013, Evgeniy Khramtsov %%% @copyright (C) 2002-2015, ProcessOne
%%% @doc %%% @doc
%%% %%%
%%% @end %%% @end

View File

@ -42,16 +42,19 @@ is_elixir_available() ->
undefined_function(?MODULE, Func, Args) -> undefined_function(?MODULE, Func, Args) ->
case lists:suffix(".exs", atom_to_list(Func)) of case lists:suffix(".exs", atom_to_list(Func)) of
true -> true ->
'Elixir.ExUnit':start([]), run_elixir_test(Func);
'Elixir.Code':load_file(list_to_binary(filename:join(test_dir(), atom_to_list(Func)))),
'Elixir.ExUnit':run();
false -> false ->
error_handler:undefined_function(?MODULE, Func, Args) error_handler:undefined_function(?MODULE, Func, Args)
end; end;
undefined_function(Module, Func, Args) -> undefined_function(Module, Func, Args) ->
error_handler:undefined_function(Module, Func,Args). error_handler:undefined_function(Module, Func,Args).
run_elixir_test(Func) ->
'Elixir.ExUnit':start([]),
'Elixir.Code':load_file(list_to_binary(filename:join(test_dir(), atom_to_list(Func)))),
#{failures := 0} = 'Elixir.ExUnit':run().
test_dir() -> test_dir() ->
{ok, CWD} = file:get_cwd(), {ok, CWD} = file:get_cwd(),
filename:join(CWD, "../../test"). filename:join(CWD, "../../test").