From 1e8ce22e1ee8d1eec2a25ca6b8dd69f15dbed23c Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Wed, 29 Apr 2020 23:39:45 +0000 Subject: [PATCH] bare compiler hooks do work and this shows it. I had misread the code in issue #2200 -- the per-app hooks are still run, just not the umbrella-level hooks. --- test/rebar_hooks_SUITE.erl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/rebar_hooks_SUITE.erl b/test/rebar_hooks_SUITE.erl index 29e343f0..315c00df 100644 --- a/test/rebar_hooks_SUITE.erl +++ b/test/rebar_hooks_SUITE.erl @@ -131,13 +131,19 @@ bare_compile_hooks_default_ns(Config) -> Vsn = rebar_test_utils:create_random_vsn(), rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), - RConfFile = rebar_test_utils:create_config(AppDir, - [{provider_hooks, [{post, [{compile, clean}]}]}]), + HookFile = filename:join([?config(priv_dir, Config), "bare-post.hook"]), + + ConfOpts = [{provider_hooks, [{post, [{compile, clean}]}]}, + {post_hooks, [{compile, "ls > " ++ HookFile}]}], + RConfFile = rebar_test_utils:create_config(AppDir, ConfOpts), {ok, RConf} = file:consult(RConfFile), rebar_test_utils:run_and_check( Config, RConf, ["bare", "compile", "--paths", "."], {ok, []} - ). + ), + %% check that hooks did actually run + ?assertMatch({ok, _}, file:read_file(HookFile)), + ok. deps_clean_hook_namespace(Config) -> mock_git_resource:mock([{deps, [{some_dep, "0.0.1"}]}]),