diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2018-11-17 11:46:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-17 11:46:25 -0500 |
commit | b8665dd081db394fb373a42165dfcc04ef1a87f3 (patch) | |
tree | 11360f01f78aa869d6bb2211c6f6d65d0ab1567d /test | |
parent | 5944b14f570ee3b42debe71f4628c7ef7824984c (diff) | |
parent | 5facb035fe67a0e2683c6460833ac1ec8baa8c82 (diff) |
Merge pull request #1941 from tothlac/1940
Support alias format {Namespace, Cmd} and {Namespace, Cmd, Args} (#1940)
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_alias_SUITE.erl | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/test/rebar_alias_SUITE.erl b/test/rebar_alias_SUITE.erl index 2544aac..d6e27d9 100644 --- a/test/rebar_alias_SUITE.erl +++ b/test/rebar_alias_SUITE.erl @@ -13,8 +13,8 @@ init_per_testcase(_, Config) -> end_per_testcase(_, _Config) -> ok. -all() -> [command, args, many, override_default, no_circular, release]. - %% namespaces: unsupported, untested. +all() -> [command, args, many, override_default, no_circular, release, + check_namespaces, create_lib]. command() -> [{doc, "Runs multiple regular commands as one alias"}]. @@ -136,3 +136,30 @@ release(Config) -> ["the_rel2"], {ok, [{release, the_release, Vsn, false}]}), ok. + +check_namespaces() -> + [{doc, "Test calling commands with namespaces from rebar3"}]. +check_namespaces(Config) -> + AppDir = ?config(apps, Config), + Name = rebar_test_utils:create_random_name("alias_args_"), + Vsn = rebar_test_utils:create_random_vsn(), + rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), + RebarConfig = [{alias, [{test, [{eunit,"-c"}, {plugins, list}]}]}], + rebar_test_utils:run_and_check(Config, RebarConfig, + ["test"], {ok, [{app, Name}]}), + ok. + +create_lib() -> + [{doc, "Test calling commands with namespaces from rebar3"}]. +create_lib(Config) -> + AppDir = ?config(apps, Config), + Name = rebar_test_utils:create_random_name("create_lib_"), + Vsn = rebar_test_utils:create_random_vsn(), + rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), + RebarConfig = [{alias, [{test, [compile, {do, "new lib shouldexist"}]}]}], + rebar_test_utils:run_and_check(Config, RebarConfig, + ["test"], {ok, [{app, Name}]}), + AppFile = filename:join(?config(apps, Config), + "../../../../shouldexist/src/shouldexist.app.src"), + ?assert(filelib:is_file(AppFile)), + ok. |