summaryrefslogtreecommitdiff
path: root/test/rebar_hooks_SUITE.erl
diff options
context:
space:
mode:
authorfeng19 <feng_19@foxmail.com>2018-06-21 10:24:56 +0800
committerfeng19 <feng_19@foxmail.com>2018-06-21 10:24:56 +0800
commit482718b8bf31024d919aabad1da2e9116411f2aa (patch)
tree1c693d007b98b0fc31a23aac19abbf94096ad9ef /test/rebar_hooks_SUITE.erl
parentdc0f8b4d66d12c10ed4df85148b5e8ce13056f40 (diff)
parent38865da7ba01e7d5e60316e970f01959e85759ee (diff)
Merge tag '3.6.0' into refresh_paths
Bump to 3.6.0 - Introduce support of add and del operations for overrides - OTP-21 compatibility - Bump cth_readable for OTP-21 compat - upgrade relx to 3.25.0 - upgrade bbmustache to 1.5.0 - run compile provider in default namespace from bare compiling (fixes hooks for mix builds) - Resolve string vs list crashing rebar3 in erl_first_files - Create ERLANG_LIB_*_erl_interface environment variables only if erl_interface exists - Add hooks to the upgrade command - Add --start-clean flag to rebar3 shell - Auto-boot main app in OTP app project templates - Use maps for child spec examples in templates
Diffstat (limited to 'test/rebar_hooks_SUITE.erl')
-rw-r--r--test/rebar_hooks_SUITE.erl19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/rebar_hooks_SUITE.erl b/test/rebar_hooks_SUITE.erl
index a36dbe1..1f3edd2 100644
--- a/test/rebar_hooks_SUITE.erl
+++ b/test/rebar_hooks_SUITE.erl
@@ -13,6 +13,7 @@
run_hooks_for_plugins/1,
eunit_app_hooks/1,
deps_hook_namespace/1,
+ bare_compile_hooks_default_ns/1,
deps_clean_hook_namespace/1]).
-include_lib("common_test/include/ct.hrl").
@@ -37,7 +38,7 @@ end_per_testcase(_, _Config) ->
all() ->
[build_and_clean_app, run_hooks_once, run_hooks_once_profiles,
escriptize_artifacts, run_hooks_for_plugins, deps_hook_namespace,
- deps_clean_hook_namespace, eunit_app_hooks].
+ bare_compile_hooks_default_ns, deps_clean_hook_namespace, eunit_app_hooks].
%% Test post provider hook cleans compiled project app, leaving it invalid
build_and_clean_app(Config) ->
@@ -135,6 +136,22 @@ deps_hook_namespace(Config) ->
{ok, [{dep, "some_dep"}]}
).
+%% tests that hooks to compile when running bare compile run in the default namespace
+bare_compile_hooks_default_ns(Config) ->
+ AppDir = ?config(apps, Config),
+
+ Name = rebar_test_utils:create_random_name("app1_"),
+ 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}]}]}]),
+ {ok, RConf} = file:consult(RConfFile),
+ rebar_test_utils:run_and_check(
+ Config, RConf, ["bare", "compile", "--paths", "."],
+ {ok, []}
+ ).
+
deps_clean_hook_namespace(Config) ->
mock_git_resource:mock([{deps, [{some_dep, "0.0.1"}]}]),
Deps = rebar_test_utils:expand_deps(git, [{"some_dep", "0.0.1", []}]),