diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-06-19 10:19:12 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-06-19 10:19:12 -0400 |
commit | 70dbbf95c24c054514e0ef2ba28c765d33bbf5d7 (patch) | |
tree | 8b1bcec2ea3ed1a3adf3a8211d59bab985a4464b /test/rebar_compile_SUITE.erl | |
parent | 4edfed60a201921995cea987494839eeb6b75638 (diff) | |
parent | f7ff07a87d3e282b4016c1725d149389b0d3b6f9 (diff) |
Merge pull request #505 from tsloughter/plugins_provider
plugins provider
Diffstat (limited to 'test/rebar_compile_SUITE.erl')
-rw-r--r-- | test/rebar_compile_SUITE.erl | 133 |
1 files changed, 1 insertions, 132 deletions
diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl index 7025eef..7e72404 100644 --- a/test/rebar_compile_SUITE.erl +++ b/test/rebar_compile_SUITE.erl @@ -18,9 +18,6 @@ deps_in_path/1, delete_beam_if_source_deleted/1, checkout_priority/1, - compile_plugins/1, - compile_global_plugins/1, - complex_plugins/1, highest_version_of_pkg_dep/1, parse_transform_test/1]). @@ -49,8 +46,7 @@ all() -> build_all_srcdirs, recompile_when_hrl_changes, recompile_when_opts_change, dont_recompile_when_opts_dont_change, dont_recompile_yrl_or_xrl, delete_beam_if_source_deleted, - deps_in_path, checkout_priority, compile_plugins, compile_global_plugins, - complex_plugins, highest_version_of_pkg_dep, parse_transform_test]. + deps_in_path, checkout_priority, highest_version_of_pkg_dep, parse_transform_test]. build_basic_app(Config) -> AppDir = ?config(apps, Config), @@ -399,133 +395,6 @@ checkout_priority(Config) -> ?assertEqual(Vsn2, proplists:get_value(vsn, DepProps)), ?assertEqual(Vsn2, proplists:get_value(vsn, PkgProps)). -%% Tests that compiling a project installs and compiles the plugins of deps -compile_plugins(Config) -> - AppDir = ?config(apps, Config), - - Name = rebar_test_utils:create_random_name("app1_"), - Vsn = rebar_test_utils:create_random_vsn(), - rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), - - DepName = rebar_test_utils:create_random_name("dep1_"), - PluginName = rebar_test_utils:create_random_name("plugin1_"), - - Plugins = rebar_test_utils:expand_deps(git, [{PluginName, Vsn, []}]), - mock_git_resource:mock([{deps, rebar_test_utils:flat_deps(Plugins)}]), - - mock_pkg_resource:mock([{pkgdeps, [{{list_to_binary(DepName), list_to_binary(Vsn)}, []}]}, - {config, [{plugins, [ - {list_to_atom(PluginName), - {git, "http://site.com/user/"++PluginName++".git", - {tag, Vsn}}}]}]}]), - - RConfFile = - rebar_test_utils:create_config(AppDir, - [{deps, [ - list_to_atom(DepName) - ]}]), - {ok, RConf} = file:consult(RConfFile), - - %% Build with deps. - rebar_test_utils:run_and_check( - Config, RConf, ["compile"], - {ok, [{app, Name}, {plugin, PluginName}, {dep, DepName}]} - ). - -%% Tests that compiling a project installs and compiles the global plugins -compile_global_plugins(Config) -> - AppDir = ?config(apps, Config), - GlobalDir = filename:join(AppDir, "global"), - GlobalConfigDir = filename:join([GlobalDir, ".config", "rebar3"]), - GlobalConfig = filename:join([GlobalDir, ".config", "rebar3", "rebar.config"]), - - meck:new(rebar_dir, [passthrough]), - meck:expect(rebar_dir, global_config, fun() -> GlobalConfig end), - meck:expect(rebar_dir, global_cache_dir, fun(_) -> GlobalDir end), - - Name = rebar_test_utils:create_random_name("app1_"), - Vsn = rebar_test_utils:create_random_vsn(), - Vsn2 = rebar_test_utils:create_random_vsn(), - rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), - - DepName = rebar_test_utils:create_random_name("dep1_"), - PluginName = rebar_test_utils:create_random_name("plugin1_"), - - mock_git_resource:mock([{deps, [{list_to_atom(PluginName), Vsn}, - {list_to_atom(PluginName), Vsn2}, - {{iolist_to_binary(DepName), iolist_to_binary(Vsn)}, []}]}]), - - - rebar_test_utils:create_config(GlobalConfigDir, - [{plugins, [ - {list_to_atom(PluginName), {git, "http://site.com/user/"++PluginName++".git", {tag, Vsn}}} - ]}]), - RConfFile = - rebar_test_utils:create_config(AppDir, - [{deps, [ - {list_to_atom(DepName), {git, "http://site.com/user/"++DepName++".git", {tag, Vsn}}} - ]}, - {plugins, [ - {list_to_atom(PluginName), {git, "http://site.com/user/"++PluginName++".git", {tag, Vsn2}}} - ]}]), - {ok, RConf} = file:consult(RConfFile), - - %% Runs global plugin install - rebar3:init_config(), - - %% Build with deps. - rebar_test_utils:run_and_check( - Config, RConf, ["compile"], - {ok, [{app, Name}, - {global_plugin, PluginName, Vsn}, - {plugin, PluginName, Vsn2}, - {dep, DepName}]} - ), - - meck:unload(rebar_dir). - -%% Tests installing of plugin with transitive deps -complex_plugins(Config) -> - AppDir = ?config(apps, Config), - - meck:new(rebar_dir, [passthrough]), - - Name = rebar_test_utils:create_random_name("app1_"), - Vsn = rebar_test_utils:create_random_vsn(), - Vsn2 = rebar_test_utils:create_random_vsn(), - rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), - - DepName = rebar_test_utils:create_random_name("dep1_"), - DepName2 = rebar_test_utils:create_random_name("dep2_"), - DepName3 = rebar_test_utils:create_random_name("dep3_"), - PluginName = rebar_test_utils:create_random_name("plugin1_"), - - Deps = rebar_test_utils:expand_deps(git, [{PluginName, Vsn2, [{DepName2, Vsn, - [{DepName3, Vsn, []}]}]} - ,{DepName, Vsn, []}]), - mock_git_resource:mock([{deps, rebar_test_utils:flat_deps(Deps)}]), - - RConfFile = - rebar_test_utils:create_config(AppDir, - [{deps, [ - {list_to_atom(DepName), {git, "http://site.com/user/"++DepName++".git", {tag, Vsn}}} - ]}, - {plugins, [ - {list_to_atom(PluginName), {git, "http://site.com/user/"++PluginName++".git", {tag, Vsn2}}} - ]}]), - {ok, RConf} = file:consult(RConfFile), - - %% Build with deps. - rebar_test_utils:run_and_check( - Config, RConf, ["compile"], - {ok, [{app, Name}, - {plugin, PluginName, Vsn2}, - {plugin, DepName2}, - {plugin, DepName3}, - {dep, DepName}]} - ), - - meck:unload(rebar_dir). highest_version_of_pkg_dep(Config) -> AppDir = ?config(apps, Config), |