Selaa lähdekoodia

add test for provider_hook clean

pull/1698/head
Carl-Johan Kjellander 7 vuotta sitten
vanhempi
commit
a3b5846b49
1 muutettua tiedostoa jossa 25 lisäystä ja 2 poistoa
  1. +25
    -2
      test/rebar_hooks_SUITE.erl

+ 25
- 2
test/rebar_hooks_SUITE.erl Näytä tiedosto

@ -12,7 +12,8 @@
run_hooks_once_profiles/1, run_hooks_once_profiles/1,
run_hooks_for_plugins/1, run_hooks_for_plugins/1,
eunit_app_hooks/1, eunit_app_hooks/1,
deps_hook_namespace/1]).
deps_hook_namespace/1,
deps_clean_hook_namespace/1]).
-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
@ -36,7 +37,7 @@ end_per_testcase(_, _Config) ->
all() -> all() ->
[build_and_clean_app, run_hooks_once, run_hooks_once_profiles, [build_and_clean_app, run_hooks_once, run_hooks_once_profiles,
escriptize_artifacts, run_hooks_for_plugins, deps_hook_namespace, escriptize_artifacts, run_hooks_for_plugins, deps_hook_namespace,
eunit_app_hooks].
deps_clean_hook_namespace, eunit_app_hooks].
%% Test post provider hook cleans compiled project app, leaving it invalid %% Test post provider hook cleans compiled project app, leaving it invalid
build_and_clean_app(Config) -> build_and_clean_app(Config) ->
@ -134,6 +135,28 @@ deps_hook_namespace(Config) ->
{ok, [{dep, "some_dep"}]} {ok, [{dep, "some_dep"}]}
). ).
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", []}]),
TopDeps = rebar_test_utils:top_level_deps(Deps),
RebarConfig = [
{deps, TopDeps},
{overrides, [
{override, some_dep, [
{provider_hooks, [
{pre, [
{compile, clean}
]}
]}
]}
]}
],
rebar_test_utils:run_and_check(
Config, RebarConfig, ["clean"],
{ok, [{dep, "some_dep"}]}
).
%% Checks that a hook that is defined on an app (not a top level hook of a project with subapps) is run %% Checks that a hook that is defined on an app (not a top level hook of a project with subapps) is run
eunit_app_hooks(Config) -> eunit_app_hooks(Config) ->
AppDir = ?config(apps, Config), AppDir = ?config(apps, Config),

Ladataan…
Peruuta
Tallenna