diff options
Diffstat (limited to 'test/elixir_SUITE.erl')
-rw-r--r-- | test/elixir_SUITE.erl | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/test/elixir_SUITE.erl b/test/elixir_SUITE.erl index b9a0b1a2..f2c64773 100644 --- a/test/elixir_SUITE.erl +++ b/test/elixir_SUITE.erl @@ -19,6 +19,7 @@ init_per_suite(Config) -> check_meck(), + code:add_pathz(filename:join(test_dir(), "../include")), Config. init_per_testcase(_TestCase, Config) -> @@ -27,13 +28,13 @@ init_per_testcase(_TestCase, Config) -> all() -> case is_elixir_available() of - true -> - Dir = test_dir(), - filelib:fold_files(Dir, ".*\.exs", false, - fun(Filename, Acc) -> [list_to_atom(filename:basename(Filename)) | Acc] end, - []); - false -> - [] + true -> + Dir = test_dir(), + filelib:fold_files(Dir, ".*\.exs", false, + fun(Filename, Acc) -> [list_to_atom(filename:basename(Filename)) | Acc] end, + []); + false -> + [] end. check_meck() -> @@ -56,16 +57,21 @@ is_elixir_available() -> undefined_function(?MODULE, Func, Args) -> case lists:suffix(".exs", atom_to_list(Func)) of - true -> - run_elixir_test(Func); - false -> - error_handler:undefined_function(?MODULE, Func, Args) + true -> + run_elixir_test(Func); + false -> + error_handler:undefined_function(?MODULE, Func, Args) end; undefined_function(Module, Func, Args) -> error_handler:undefined_function(Module, Func,Args). run_elixir_test(Func) -> 'Elixir.ExUnit':start([]), + filelib:fold_files(test_dir(), ".*\\.exs\$", true, + fun (File, N) -> + 'Elixir.Code':require_file(list_to_binary(File)), + N+1 + end, 0), 'Elixir.Code':load_file(list_to_binary(filename:join(test_dir(), atom_to_list(Func)))), %% I did not use map syntax, so that this file can still be build under R16 ResultMap = 'Elixir.ExUnit':run(), |