diff options
-rw-r--r-- | src/rebar_prv_common_test.erl | 4 | ||||
-rw-r--r-- | test/rebar_ct_SUITE.erl | 22 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl index 180061c..ae0690a 100644 --- a/src/rebar_prv_common_test.erl +++ b/src/rebar_prv_common_test.erl @@ -167,7 +167,9 @@ cfgopts(State) -> ensure_opts([], Acc) -> lists:reverse(Acc); ensure_opts([{test_spec, _}|_Rest], _Acc) -> - ?PRV_ERROR({badconfig, "Test specs not supported"}); + ?PRV_ERROR({badconfig, "Test specs not supported. See http://www.rebar3.org/docs/running-tests#common-test"}); +ensure_opts([{cover, _}|_Rest], _Acc) -> + ?PRV_ERROR({badconfig, "Cover specs not supported. See http://www.rebar3.org/docs/running-tests#common-test"}); ensure_opts([{auto_compile, _}|_Rest], _Acc) -> ?PRV_ERROR({badconfig, "Auto compile not supported"}); ensure_opts([{suite, Suite}|Rest], Acc) when is_integer(hd(Suite)) -> diff --git a/test/rebar_ct_SUITE.erl b/test/rebar_ct_SUITE.erl index 94ab690..a3785e3 100644 --- a/test/rebar_ct_SUITE.erl +++ b/test/rebar_ct_SUITE.erl @@ -41,6 +41,7 @@ cfg_opts/1, cfg_arbitrary_opts/1, cfg_test_spec/1, + cfg_cover_spec/1, cfg_atom_suites/1, cover_compiled/1, misspecified_ct_opts/1, @@ -56,7 +57,7 @@ all() -> [{group, basic_app}, {group, ct_opts}, {group, cover}, cfg_opts, cfg_arbitrary_opts, - cfg_test_spec, + cfg_test_spec, cfg_cover_spec, cfg_atom_suites, misspecified_ct_opts, misspecified_ct_compile_opts, @@ -1026,7 +1027,24 @@ cfg_test_spec(Config) -> {error, {rebar_prv_common_test, Error}} = rebar_prv_common_test:prepare_tests(State), - {badconfig, "Test specs not supported"} = Error. + {badconfig, "Test specs not supported. See http://www.rebar3.org/docs/running-tests#common-test"} = Error. + +cfg_cover_spec(Config) -> + C = rebar_test_utils:init_rebar_state(Config, "ct_cfg_cover_spec_opts_"), + + AppDir = ?config(apps, C), + + Name = rebar_test_utils:create_random_name("ct_cfg_cover_spec_opts_"), + Vsn = rebar_test_utils:create_random_vsn(), + rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), + + RebarConfig = [{ct_opts, [{cover, "spec/foo.spec"}]}], + + {ok, State} = rebar_test_utils:run_and_check(C, RebarConfig, ["as", "test", "lock"], return), + + {error, {rebar_prv_common_test, Error}} = rebar_prv_common_test:prepare_tests(State), + + {badconfig, "Cover specs not supported. See http://www.rebar3.org/docs/running-tests#common-test"} = Error. cfg_atom_suites(Config) -> C = rebar_test_utils:init_rebar_state(Config, "ct_cfg_atom_suites_"), |