diff options
author | tothlac <tothlac@gmail.com> | 2018-11-11 17:12:41 +0100 |
---|---|---|
committer | tothlac <tothlac@gmail.com> | 2018-11-17 16:10:07 +0100 |
commit | 5facb035fe67a0e2683c6460833ac1ec8baa8c82 (patch) | |
tree | 11360f01f78aa869d6bb2211c6f6d65d0ab1567d /test | |
parent | 5944b14f570ee3b42debe71f4628c7ef7824984c (diff) |
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. |