diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_compile_SUITE.erl | 21 | ||||
-rw-r--r-- | test/rebar_test_utils.erl | 8 |
2 files changed, 28 insertions, 1 deletions
diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl index 10effda..269413e 100644 --- a/test/rebar_compile_SUITE.erl +++ b/test/rebar_compile_SUITE.erl @@ -23,7 +23,7 @@ all() -> deps_in_path, checkout_priority, highest_version_of_pkg_dep, parse_transform_test, erl_first_files_test, mib_test, umbrella_mib_first_test, only_default_transitive_deps, clean_all, - profile_deps, deps_build_in_prod, + profile_deps, deps_build_in_prod, only_deps, override_deps, override_add_deps, override_del_deps, override_opts, override_add_opts, override_del_opts, apply_overrides_exactly_once, @@ -1655,6 +1655,25 @@ profile_deps(Config) -> {ok, [{dep, "some_dep"},{dep, "other_dep"}]} ). +only_deps(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]), + + Deps = rebar_test_utils:expand_deps(git, [{"some_dep", "0.0.1", [{"other_dep", "0.0.1", []}]}]), + TopDeps = rebar_test_utils:top_level_deps(Deps), + {SrcDeps, _} = rebar_test_utils:flat_deps(Deps), + mock_git_resource:mock([{deps, SrcDeps}]), + + RConfFile = rebar_test_utils:create_config(AppDir, [{deps, TopDeps}]), + {ok, RConf} = file:consult(RConfFile), + rebar_test_utils:run_and_check( + Config, RConf, ["compile", "--deps_only"], + {ok, [{app_not_exist, Name}, {dep, "some_dep"},{dep, "other_dep"}]} + ). + %% verify a deps prod profile is used %% tested by checking prod hooks run and outputs to default profile dir for dep %% and prod deps are installed for dep diff --git a/test/rebar_test_utils.erl b/test/rebar_test_utils.erl index 8bcb6d1..efe7467 100644 --- a/test/rebar_test_utils.erl +++ b/test/rebar_test_utils.erl @@ -266,6 +266,14 @@ check_results(AppDir, Expected, ProfileRun) -> ok end ; ({dep_not_exist, Name}) -> + ct:pal("Dep Not Exist Name: ~p", [Name]), + case lists:keyfind(Name, 1, DepsNames) of + false -> + ok; + {Name, _App} -> + error({app_found, Name}) + end + ; ({app_not_exist, Name}) -> ct:pal("App Not Exist Name: ~p", [Name]), case lists:keyfind(Name, 1, DepsNames) of false -> |