diff options
Diffstat (limited to 'systest')
-rw-r--r-- | systest/all_SUITE.erl | 24 | ||||
-rw-r--r-- | systest/all_SUITE_data/alias_clash/rebar.config | 4 | ||||
-rw-r--r-- | systest/all_SUITE_data/alias_clash/src/alias_clash.app.src | 15 | ||||
-rw-r--r-- | systest/all_SUITE_data/alias_clash/src/alias_clash.erl | 13 |
4 files changed, 53 insertions, 3 deletions
diff --git a/systest/all_SUITE.erl b/systest/all_SUITE.erl index 523e739..a0cfd3f 100644 --- a/systest/all_SUITE.erl +++ b/systest/all_SUITE.erl @@ -29,7 +29,7 @@ end_per_testcase(_Name, Config) -> Config. all() -> - [noop, resource_plugins]. + [noop, resource_plugins, alias_clash]. %groups() -> % [{plugins, [shuffle], []}, @@ -53,6 +53,21 @@ resource_plugins(Config) -> ct:pal("Rebar3 Output:~n~s",[Output]), ok. +alias_clash() -> + [{doc, "checking that the provider won't get plugin interference."}, + {timetrap, 10000}]. +alias_clash(Config) -> + {ok, Help} = rebar3("help", Config), % should be redefined, but by the plugin + ?assertNotEqual(nomatch, + re:run(Help, "Alias help is already the name of a command[a-z ]+and will be ignored") + ), + {ok, Output} = rebar3("test", Config, [{env, [{"DEBUG", "1"}]}]), + ?assertNotEqual(nomatch, re:run(Output, "cover summary written to:")), + ?assertNotEqual(nomatch, + re:run(Output, "Not adding provider default test from module rebar_prv_alias_test " + "because it already exists from module rebar_prv_alias_test")), + ok. + %%%%%%%%%%%%%%% %%% Helpers %%% %%%%%%%%%%%%%%% @@ -62,7 +77,9 @@ set_name_config(Atom, Config) -> atom_to_list(?MODULE)++"_data", atom_to_list(Atom)])} | Config]. -rebar3(Args, Config) -> +rebar3(Args, Config) -> rebar3(Args, Config, []). + +rebar3(Args, Config, UserOpts) -> Exec = case os:type() of {win32, _} -> "rebar3.cmd"; @@ -70,6 +87,7 @@ rebar3(Args, Config) -> "rebar3" end, Cmd = Exec ++ " " ++ Args, - Opts = [{cd, ?config(path, Config)}, return_on_error, use_stdout], + Opts = [{cd, ?config(path, Config)}, return_on_error, use_stdout + | UserOpts], ct:pal("Calling rebar3 ~s with options ~p", [Cmd, Opts]), rebar_utils:sh(Cmd, Opts). diff --git a/systest/all_SUITE_data/alias_clash/rebar.config b/systest/all_SUITE_data/alias_clash/rebar.config new file mode 100644 index 0000000..baf20a9 --- /dev/null +++ b/systest/all_SUITE_data/alias_clash/rebar.config @@ -0,0 +1,4 @@ +{alias, [{help, [version]}, % should be skipped, but be overriden by plugin + {test, [compile, {eunit, "-c"}, cover]}]}. + +{plugins, [rebar_alias]}. % should be overridden diff --git a/systest/all_SUITE_data/alias_clash/src/alias_clash.app.src b/systest/all_SUITE_data/alias_clash/src/alias_clash.app.src new file mode 100644 index 0000000..b4cdda2 --- /dev/null +++ b/systest/all_SUITE_data/alias_clash/src/alias_clash.app.src @@ -0,0 +1,15 @@ +{application, alias_clash, + [{description, "An OTP library"}, + {vsn, "0.1.0"}, + {registered, []}, + {applications, + [kernel, + stdlib + ]}, + {env,[]}, + {modules, []}, + + {maintainers, []}, + {licenses, ["Apache 2.0"]}, + {links, []} + ]}. diff --git a/systest/all_SUITE_data/alias_clash/src/alias_clash.erl b/systest/all_SUITE_data/alias_clash/src/alias_clash.erl new file mode 100644 index 0000000..9249cdb --- /dev/null +++ b/systest/all_SUITE_data/alias_clash/src/alias_clash.erl @@ -0,0 +1,13 @@ +-module(alias_clash). + +%% API exports +-export([]). + +%%==================================================================== +%% API functions +%%==================================================================== + + +%%==================================================================== +%% Internal functions +%%==================================================================== |