summaryrefslogtreecommitdiff
path: root/test/rebar_test_utils.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/rebar_test_utils.erl')
-rw-r--r--test/rebar_test_utils.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/rebar_test_utils.erl b/test/rebar_test_utils.erl
index 2eb14ac..d245c82 100644
--- a/test/rebar_test_utils.erl
+++ b/test/rebar_test_utils.erl
@@ -158,6 +158,7 @@ top_level_deps([{{Name, Vsn, Ref}, _} | Deps]) ->
%%%%%%%%%%%%%%%
check_results(AppDir, Expected) ->
BuildDirs = filelib:wildcard(filename:join([AppDir, "_build", "*", "lib"])),
+ PluginDirs = filelib:wildcard(filename:join([AppDir, "_build", "*", "plugins"])),
CheckoutsDir = filename:join([AppDir, "_checkouts"]),
LockFile = filename:join([AppDir, "rebar.lock"]),
Locks = lists:flatten(rebar_config:consult_file(LockFile)),
@@ -172,6 +173,8 @@ check_results(AppDir, Expected) ->
DepsNames = [{ec_cnv:to_list(rebar_app_info:name(App)), App} || App <- Deps],
Checkouts = rebar_app_discover:find_apps([CheckoutsDir], all),
CheckoutsNames = [{ec_cnv:to_list(rebar_app_info:name(App)), App} || App <- Checkouts],
+ Plugins = rebar_app_discover:find_apps(PluginDirs, all),
+ PluginsNames = [{ec_cnv:to_list(rebar_app_info:name(App)), App} || App <- Plugins],
lists:foreach(
fun({app, Name}) ->
@@ -213,6 +216,18 @@ check_results(AppDir, Expected) ->
?assertEqual(iolist_to_binary(Vsn),
iolist_to_binary(rebar_app_info:original_vsn(App)))
end
+ ; ({plugin, Name}) ->
+ ct:pal("Name: ~p", [Name]),
+ ?assertNotEqual(false, lists:keyfind(Name, 1, PluginsNames))
+ ; ({plugin, Name, Vsn}) ->
+ ct:pal("Name: ~p, Vsn: ~p", [Name, Vsn]),
+ case lists:keyfind(Name, 1, PluginsNames) of
+ false ->
+ error({dep_not_found, Name});
+ {Name, App} ->
+ ?assertEqual(iolist_to_binary(Vsn),
+ iolist_to_binary(rebar_app_info:original_vsn(App)))
+ end
; ({lock, Name}) ->
ct:pal("Name: ~p", [Name]),
?assertNotEqual(false, lists:keyfind(iolist_to_binary(Name), 1, Locks))