diff options
author | Tristan Sloughter <t@crashfast.com> | 2015-09-06 10:21:36 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2015-09-06 14:50:08 -0500 |
commit | cfd4beb99daf5f0686cb2bd6a2ecda9d8e0fe86c (patch) | |
tree | 81066dd8c3d4e32e79945a6f5f4d7fafae2027b4 /test | |
parent | 768889ad177cfb10d3cbace36047fba2f16a1315 (diff) |
hooks/artifacts are always run/resolved from an app unless at top of umbrella
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_hooks_SUITE.erl | 22 |
1 files changed, 18 insertions, 4 deletions
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), |