diff options
author | Tristan Sloughter <t@crashfast.com> | 2018-09-19 08:24:38 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-19 08:24:38 -0600 |
commit | 8e0ef83de48968fed80114cc4518004ed59fa649 (patch) | |
tree | c828ff31ad02e4d2101234ac1b8bec1e7f71ba54 /test | |
parent | 43769ae87f7c60a9b6cb3bf08085a4a4206961b7 (diff) |
add option to compiler provider to only build dependencies (#1888)
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 -> |