Parcourir la source

add compile_only option to ct provider

pull/1587/head
Tristan Sloughter il y a 8 ans
Parent
révision
15461c9b1e
1 fichiers modifiés avec 12 ajouts et 2 suppressions
  1. +12
    -2
      src/rebar_prv_common_test.erl

+ 12
- 2
src/rebar_prv_common_test.erl Voir le fichier

@ -41,7 +41,14 @@ do(State) ->
Tests = prepare_tests(State), Tests = prepare_tests(State),
case compile(State, Tests) of case compile(State, Tests) of
%% successfully compiled apps %% successfully compiled apps
{ok, S} -> do(S, Tests);
{ok, S} ->
{RawOpts, _} = rebar_state:command_parsed_args(S),
case proplists:get_value(compile_only, RawOpts, false) of
true ->
{ok, S};
false ->
do(S, Tests)
end;
%% this should look like a compiler error, not a ct error %% this should look like a compiler error, not a ct error
Error -> Error Error -> Error
end. end.
@ -743,9 +750,12 @@ ct_opts(_State) ->
{name, undefined, "name", atom, help(name)}, {name, undefined, "name", atom, help(name)},
{sname, undefined, "sname", atom, help(sname)}, {sname, undefined, "sname", atom, help(sname)},
{setcookie, undefined, "setcookie", atom, help(setcookie)}, {setcookie, undefined, "setcookie", atom, help(setcookie)},
{sys_config, undefined, "sys_config", string, help(sys_config)} %% comma-separated list
{sys_config, undefined, "sys_config", string, help(sys_config)}, %% comma-separated list
{compile_only, undefined, "compile_only", boolean, help(compile_only)}
]. ].
help(compile_only) ->
"Compile modules in the project with the test configuration but do not run the tests";
help(dir) -> help(dir) ->
"List of additional directories containing test suites"; "List of additional directories containing test suites";
help(suite) -> help(suite) ->

Chargement…
Annuler
Enregistrer