From 76e1d89bac2742ca6973ce028dad5a43b1484637 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Wed, 2 Mar 2016 11:06:17 -0500 Subject: Take CT options errors and turn them to warnings The idea is that given we accept arbitrary config items for CT, we should similarly be able to pass unsupported options and keep things running. However for unsupported options, a warning is very useful to have. --- src/rebar_prv_common_test.erl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl index 8c5c4fa..784b682 100644 --- a/src/rebar_prv_common_test.erl +++ b/src/rebar_prv_common_test.erl @@ -168,12 +168,15 @@ cfgopts(State) -> end. ensure_opts([], Acc) -> lists:reverse(Acc); -ensure_opts([{test_spec, _}|_Rest], _Acc) -> - ?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([{test_spec, _}|Rest], Acc) -> + ?WARN("Test specs not supported. See http://www.rebar3.org/docs/running-tests#common-test", []), + ensure_opts(Rest, Acc); +ensure_opts([{cover, _}|Rest], Acc) -> + ?WARN("Cover specs not supported. See http://www.rebar3.org/docs/running-tests#common-test", []), + ensure_opts(Rest, Acc); +ensure_opts([{auto_compile, _}|Rest], Acc) -> + ?WARN("Auto compile not supported", []), + ensure_opts(Rest, Acc); ensure_opts([{suite, Suite}|Rest], Acc) when is_integer(hd(Suite)) -> ensure_opts(Rest, [{suite, Suite}|Acc]); ensure_opts([{suite, Suite}|Rest], Acc) when is_atom(Suite) -> -- cgit v1.1