From 93cb2329a04a7a25e2ca7f0984d49529fbd5b458 Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Tue, 1 Mar 2016 13:38:08 -0800 Subject: error on a cover spec in ct_opts --- test/rebar_ct_SUITE.erl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'test/rebar_ct_SUITE.erl') diff --git a/test/rebar_ct_SUITE.erl b/test/rebar_ct_SUITE.erl index 94ab690..6b6df44 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, @@ -1028,6 +1029,23 @@ cfg_test_spec(Config) -> {badconfig, "Test specs not supported"} = 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"} = Error. + cfg_atom_suites(Config) -> C = rebar_test_utils:init_rebar_state(Config, "ct_cfg_atom_suites_"), -- cgit v1.1 From 3fa202397bed4281596616eb61cd4c66360ce415 Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Tue, 1 Mar 2016 15:22:03 -0800 Subject: add a link to the docs about `test_spec` and `cover` in ct warnings --- test/rebar_ct_SUITE.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/rebar_ct_SUITE.erl') diff --git a/test/rebar_ct_SUITE.erl b/test/rebar_ct_SUITE.erl index 6b6df44..a3785e3 100644 --- a/test/rebar_ct_SUITE.erl +++ b/test/rebar_ct_SUITE.erl @@ -1027,7 +1027,7 @@ 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_"), @@ -1044,7 +1044,7 @@ cfg_cover_spec(Config) -> {error, {rebar_prv_common_test, Error}} = rebar_prv_common_test:prepare_tests(State), - {badconfig, "Cover specs not supported"} = Error. + {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_"), -- cgit v1.1