瀏覽代碼

Merge pull request #2271 from ferd/test-bare-hooks

bare compiler hooks do work and this shows it.
pull/2278/head
Fred Hebert 5 年之前
committed by GitHub
父節點
當前提交
e64364aec8
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 9 行新增3 行删除
  1. +9
    -3
      test/rebar_hooks_SUITE.erl

+ 9
- 3
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"}]}]),

Loading…
取消
儲存