diff options
Diffstat (limited to 'test/rebar_ct_SUITE.erl')
-rw-r--r-- | test/rebar_ct_SUITE.erl | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/test/rebar_ct_SUITE.erl b/test/rebar_ct_SUITE.erl index d7094ec..15dc63e 100644 --- a/test/rebar_ct_SUITE.erl +++ b/test/rebar_ct_SUITE.erl @@ -49,6 +49,7 @@ cfg_cover_spec/1, cfg_atom_suites/1, cover_compiled/1, + cover_export_name/1, misspecified_ct_opts/1, misspecified_ct_compile_opts/1, misspecified_ct_first_files/1, @@ -121,7 +122,8 @@ groups() -> [{basic_app, [], [basic_app_default_dirs, cmd_create_priv_dir, cmd_include_dir, cmd_sys_config]}, - {cover, [], [cover_compiled]}]. + {cover, [], [cover_compiled, + cover_export_name]}]. init_per_group(basic_app, Config) -> C = rebar_test_utils:init_rebar_state(Config, "ct_"), @@ -1251,6 +1253,29 @@ cover_compiled(Config) -> Mod = list_to_atom(Name), {file, _} = cover:is_compiled(Mod). +cover_export_name(Config) -> + State = ?config(result, Config), + + Providers = rebar_state:providers(State), + Namespace = rebar_state:namespace(State), + CommandProvider = providers:get_provider(ct, Providers, Namespace), + GetOptSpec = providers:opts(CommandProvider), + {ok, GetOptResult} = getopt:parse(GetOptSpec, ["--cover", "--cover_export_name=export_name"]), + + NewState = rebar_state:command_parsed_args(State, GetOptResult), + + Tests = rebar_prv_common_test:prepare_tests(NewState), + {ok, _} = rebar_prv_common_test:compile(NewState, Tests), + rebar_prv_common_test:maybe_write_coverdata(NewState), + + Name = ?config(name, Config), + Mod = list_to_atom(Name), + {file, _} = cover:is_compiled(Mod), + + Dir = rebar_dir:profile_dir(rebar_state:opts(NewState), [default, test]), + ct:pal("DIR ~s", [Dir]), + true = filelib:is_file(filename:join([Dir, "cover", "export_name.coverdata"])). + misspecified_ct_opts(Config) -> C = rebar_test_utils:init_rebar_state(Config, "ct_cfg_atom_suites_"), |