From cfd4beb99daf5f0686cb2bd6a2ecda9d8e0fe86c Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sun, 6 Sep 2015 10:21:36 -0500 Subject: hooks/artifacts are always run/resolved from an app unless at top of umbrella --- test/rebar_hooks_SUITE.erl | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/rebar_hooks_SUITE.erl b/test/rebar_hooks_SUITE.erl index 85ca0e5..188fb34 100644 --- a/test/rebar_hooks_SUITE.erl +++ b/test/rebar_hooks_SUITE.erl @@ -43,7 +43,12 @@ build_and_clean_app(Config) -> Vsn = rebar_test_utils:create_random_vsn(), rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), rebar_test_utils:run_and_check(Config, [], ["compile"], {ok, [{app, Name, valid}]}), - rebar_test_utils:run_and_check(Config, [{provider_hooks, [{post, [{compile, clean}]}]}], + RConfFile = + rebar_test_utils:create_config(AppDir, + [{provider_hooks, [{post, [{compile, clean}]}]}]), + {ok, RConf} = file:consult(RConfFile), + + rebar_test_utils:run_and_check(Config, RConf, ["compile"], {ok, [{app, Name, invalid}]}). escriptize_artifacts(Config) -> @@ -53,7 +58,7 @@ escriptize_artifacts(Config) -> Vsn = rebar_test_utils:create_random_vsn(), rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), - Artifact = "bin/"++Name, + Artifact = "{{profile_dir}}/bin/"++Name, RConfFile = rebar_test_utils:create_config(AppDir, [ @@ -69,9 +74,18 @@ escriptize_artifacts(Config) -> {missing_artifact, Artifact}}} -> ok end, - rebar_test_utils:run_and_check(Config, RConf++[{provider_hooks, [{post, [{compile, escriptize}]}]}], + RConfFile1 = + rebar_test_utils:create_config(AppDir, + [ + {escript_name, list_to_atom(Name)} + ,{artifacts, [Artifact]} + ,{provider_hooks, [{post, [{compile, escriptize}]}]} + ]), + {ok, RConf1} = file:consult(RConfFile1), + + rebar_test_utils:run_and_check(Config, RConf1, ["compile"], {ok, [{app, Name, valid} - ,{file, filename:join([AppDir, "_build/default/", Artifact])}]}). + ,{file, filename:join([AppDir, "_build/default/bin", Name])}]}). run_hooks_once(Config) -> AppDir = ?config(apps, Config), -- cgit v1.1