diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2012-08-31 22:07:42 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2012-08-31 22:07:42 +0200 |
commit | 8aadd65a3481a3bd65a9cdf43e577c690e600824 (patch) | |
tree | 01b9d368bfde5a00ffc8339958b67b0d6a32c442 | |
parent | 3cc8fb28550010ed4e603b07aaf77a5ec947e357 (diff) |
rebar_eunit: adapt to R15B02 changes
-rw-r--r-- | src/rebar_eunit.erl | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl index 532a584..b026b4b 100644 --- a/src/rebar_eunit.erl +++ b/src/rebar_eunit.erl @@ -313,6 +313,13 @@ get_beam_test_exports(ModuleStr) -> end. make_test_wrappers(RawTests) -> + %% eunit_test:function_wrapper/2 was renamed to mf_wrapper/2 in R15B02 + {module, eunit_test} = code:ensure_loaded(eunit_test), + WrapperFun = case erlang:function_exported(eunit_test, mf_wrapper, 2) of + true -> fun eunit_test:mf_wrapper/2; + false -> fun eunit_test:function_wrapper/2 + end, + ?CONSOLE(" Running test function(s):~n", []), F = fun({M, F2}, Acc) -> ?CONSOLE(" ~p:~p/0~n", [M, F2]), @@ -321,20 +328,20 @@ make_test_wrappers(RawTests) -> case re:run(FNameStr, "_test_") of nomatch -> %% Normal test - eunit_test(M, F2); + eunit_test(WrapperFun, M, F2); _ -> %% Generator - eunit_generator(M, F2) + eunit_generator(WrapperFun, M, F2) end, [NewFunction|Acc] end, lists:foldl(F, [], RawTests). -eunit_test(M, F) -> - eunit_test:function_wrapper(M, F). +eunit_test(WrapperFun, M, F) -> + WrapperFun(M, F). -eunit_generator(M, F) -> - {generator, eunit_test:function_wrapper(M, F)}. +eunit_generator(WrapperFun, M, F) -> + {generator, WrapperFun(M, F)}. %% %% == run tests == |