diff options
Diffstat (limited to 'inttest/depplugins/depplugins_rt.erl')
-rw-r--r-- | inttest/depplugins/depplugins_rt.erl | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/inttest/depplugins/depplugins_rt.erl b/inttest/depplugins/depplugins_rt.erl index 7b106eb..a45fa93 100644 --- a/inttest/depplugins/depplugins_rt.erl +++ b/inttest/depplugins/depplugins_rt.erl @@ -4,11 +4,14 @@ %%% %%% It has three applications: %%% <ol> -%%% <li>fish. top-level module, has one dependency: `dependsonplugin'.</li> -%%% <li>dependsonplugin. This depends on some pre-compile actions by the -%%% plugin. In the test the plugin creates a file `pre.compile' in the -%%% top-level folder of this application.</li> -%%% <li>testplugin. This is a plugin application which creates the file.</li> +%%% <li>fish. top-level app, has one dependency: `dependsonplugin'. +%%% It also loads a plugin from CWD which creates +%%% base_dir_cwd_pre.compile on pre_compile.</li> +%%% <li>dependsonplugin, has one dependency: `testplugin' and loads +%%% the testplugin_mod plugin.</li> +%%% <li>testplugin. This is a plugin application which creates +%%% plugin_pre.compile on pre_compile. It also loads a plugin from CWD +%%% which creates dep_cwd_pre.compile on pre_compile.</li> %%% </ol> -module(depplugins_rt). @@ -20,21 +23,37 @@ files() -> [ {copy, "../../rebar", "rebar"}, {copy, "rebar.config", "rebar.config"}, + {copy, "base_dir_cwd_plugin.erl", "base_dir_cwd_plugin.erl"}, {create, "ebin/fish.app", app(fish, [])}, - {create, "deps/dependsonplugin/ebin/dependsonplugin.app", - app(dependsonplugin, [])}, {copy, "rebar_dependsonplugin.config", - "deps/dependsonplugin/rebar.config"}, + "deps/dependsonplugin/rebar.config"}, + {create, "deps/dependsonplugin/ebin/dependsonplugin.app", + app(dependsonplugin, [])}, + + {copy, "rebar_testplugin.config", "deps/testplugin/rebar.config"}, {copy, "testplugin_mod.erl", - "deps/testplugin/plugins/testplugin_mod.erl"}, - {create, "deps/testplugin/ebin/testplugin.app", - app(testplugin, [])} + "deps/testplugin/plugins/testplugin_mod.erl"}, + {copy, "dep_cwd_plugin.erl", "deps/testplugin/dep_cwd_plugin.erl"}, + {create, "deps/testplugin/ebin/testplugin.app", app(testplugin, [])} ]. run(_Dir) -> ?assertMatch({ok, _}, retest_sh:run("./rebar compile", [])), - ?assertEqual(true, filelib:is_regular("deps/dependsonplugin/pre.compile")), + + ?assertEqual(true, filelib:is_regular("base_dir_cwd_pre.compile")), + + ?assertEqual(true, filelib:is_regular( + "deps/dependsonplugin/base_dir_cwd_pre.compile")), + ?assertEqual(true, filelib:is_regular( + "deps/dependsonplugin/plugin_pre.compile")), + + ?assertEqual(true, filelib:is_regular( + "deps/testplugin/base_dir_cwd_pre.compile")), + ?assertEqual(true, filelib:is_regular( + "deps/testplugin/dep_cwd_pre.compile")), + ?assertEqual(true, filelib:is_regular( + "deps/testplugin/plugin_pre.compile")), ok. %% |