Rename old eunit compile options for consistency with test-compile

This commit is contained in:
Tuncer Ayaz 2012-07-26 17:15:01 +02:00
parent 093f160be5
commit 228f39efa1
3 changed files with 11 additions and 10 deletions

View file

@ -22,6 +22,13 @@
{platform_define, "(linux|freebsd)", 'BACKLOG', 128}, {platform_define, "(linux|freebsd)", 'BACKLOG', 128},
{platform_define, "R13", 'old_inets'}]}. {platform_define, "R13", 'old_inets'}]}.
%% Additional compile options for test-compile. erl_opts is also used
{test_compile_opts, []}.
%% Same as erl_first_files, but used only when running 'test-compile', 'eunit',
%% or 'qc'
{test_first_files, []}.
%% MIB Options? %% MIB Options?
{mib_opts, []}. {mib_opts, []}.
@ -65,12 +72,6 @@
%% Options for eunit:test() %% Options for eunit:test()
{eunit_opts, []}. {eunit_opts, []}.
%% Additional compile options for eunit. erl_opts from above is also used
{eunit_compile_opts, []}.
%% Same as erl_first_files, but used only when running 'eunit'
{eunit_first_files, []}.
%% Whether to enable coverage reporting. Default is `false' %% Whether to enable coverage reporting. Default is `false'
{cover_enabled, false}. {cover_enabled, false}.

View file

@ -117,7 +117,7 @@ clean(_Config, _AppFile) ->
test_compile(Config) -> test_compile(Config) ->
%% Obtain all the test modules for inclusion in the compile stage. %% Obtain all the test modules for inclusion in the compile stage.
%% Notice: this could also be achieved with the following %% Notice: this could also be achieved with the following
%% rebar.config option: {eunit_compile_opts, [{src_dirs, ["test"]}]} %% rebar.config option: {test_compile_opts, [{src_dirs, ["test"]}]}
TestErls = rebar_utils:find_files("test", ".*\\.erl\$"), TestErls = rebar_utils:find_files("test", ".*\\.erl\$"),
%% Copy source files to eunit dir for cover in case they are not directly %% Copy source files to eunit dir for cover in case they are not directly
@ -171,13 +171,13 @@ test_compile_config(Config) ->
{Config3, EqcOpts} = eqc_opts(Config2), {Config3, EqcOpts} = eqc_opts(Config2),
ErlOpts = rebar_config:get_list(Config3, erl_opts, []), ErlOpts = rebar_config:get_list(Config3, erl_opts, []),
EunitOpts = rebar_config:get_list(Config3, eunit_compile_opts, []), EunitOpts = rebar_config:get_list(Config3, test_compile_opts, []),
Opts0 = [{d, 'TEST'}] ++ Opts0 = [{d, 'TEST'}] ++
ErlOpts ++ EunitOpts ++ TriqOpts ++ PropErOpts ++ EqcOpts, ErlOpts ++ EunitOpts ++ TriqOpts ++ PropErOpts ++ EqcOpts,
Opts = [O || O <- Opts0, O =/= no_debug_info], Opts = [O || O <- Opts0, O =/= no_debug_info],
Config4 = rebar_config:set(Config3, erl_opts, Opts), Config4 = rebar_config:set(Config3, erl_opts, Opts),
FirstErls = rebar_config:get_list(Config4, eunit_first_files, []), FirstErls = rebar_config:get_list(Config4, test_first_files, []),
rebar_config:set(Config4, erl_first_files, FirstErls). rebar_config:set(Config4, erl_first_files, FirstErls).
triq_opts(Config) -> triq_opts(Config) ->

View file

@ -48,7 +48,7 @@
%% Additionally, for projects that have separate folders for the core %% Additionally, for projects that have separate folders for the core
%% implementation, and for the unit tests, then the following %% implementation, and for the unit tests, then the following
%% <code>rebar.config</code> option can be provided: %% <code>rebar.config</code> option can be provided:
%% <code>{eunit_compile_opts, [{src_dirs, ["dir"]}]}.</code>. %% <code>{test_compile_opts, [{src_dirs, ["dir"]}]}.</code>.
%% @copyright 2009, 2010 Dave Smith %% @copyright 2009, 2010 Dave Smith
%% ------------------------------------------------------------------- %% -------------------------------------------------------------------
-module(rebar_eunit). -module(rebar_eunit).