summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar_git_resource.erl2
-rw-r--r--src/rebar_plugins.erl2
-rw-r--r--src/rebar_prv_common_test.erl13
-rw-r--r--src/rebar_prv_cover.erl4
-rw-r--r--src/rebar_prv_eunit.erl5
5 files changed, 18 insertions, 8 deletions
diff --git a/src/rebar_git_resource.erl b/src/rebar_git_resource.erl
index ea77b89..3aa875f 100644
--- a/src/rebar_git_resource.erl
+++ b/src/rebar_git_resource.erl
@@ -261,7 +261,7 @@ get_patch_count(Dir, RawRef) ->
parse_tags(Dir) ->
%% Don't abort on error, we want the bad return to be turned into 0.0.0
- case rebar_utils:sh("git log --oneline --no-walk --tags --decorate",
+ case rebar_utils:sh("git -c color.ui=false log --oneline --no-walk --tags --decorate",
[{use_stdout, false}, return_on_error, {cd, Dir}]) of
{error, _} ->
{undefined, "0.0.0"};
diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl
index 68ba6da..1fc01ff 100644
--- a/src/rebar_plugins.erl
+++ b/src/rebar_plugins.erl
@@ -105,7 +105,7 @@ handle_plugin(Profile, Plugin, State, Upgrade) ->
%% Add newly built deps and plugin to code path
State3 = rebar_state:update_all_plugin_deps(State2, Apps),
NewCodePaths = [rebar_app_info:ebin_dir(A) || A <- ToBuild],
- code:add_pathsa(CodePaths),
+ code:add_pathsa(NewCodePaths++CodePaths),
%% Store plugin code paths so we can remove them when compiling project apps
State4 = rebar_state:update_code_paths(State3, all_plugin_deps, CodePaths++NewCodePaths),
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl
index 9631a0d..f800610 100644
--- a/src/rebar_prv_common_test.erl
+++ b/src/rebar_prv_common_test.erl
@@ -8,8 +8,11 @@
-export([init/1,
do/1,
format_error/1]).
-%% exported for test purposes, consider private
--export([compile/2, prepare_tests/1, translate_paths/2]).
+
+-ifdef(TEST).
+%% exported for test purposes
+-export([compile/2, prepare_tests/1, translate_paths/2, maybe_write_coverdata/1]).
+-endif.
-include("rebar.hrl").
-include_lib("providers/include/providers.hrl").
@@ -728,7 +731,8 @@ maybe_write_coverdata(State) ->
true -> rebar_state:set(State, cover_enabled, true);
false -> State
end,
- rebar_prv_cover:maybe_write_coverdata(State1, ?PROVIDER).
+ Name = proplists:get_value(cover_export_name, RawOpts, ?PROVIDER),
+ rebar_prv_cover:maybe_write_coverdata(State1, Name).
ct_opts(_State) ->
[{dir, undefined, "dir", string, help(dir)}, %% comma-separated list
@@ -744,6 +748,7 @@ ct_opts(_State) ->
{logopts, undefined, "logopts", string, help(logopts)}, %% comma-separated list
{verbosity, undefined, "verbosity", integer, help(verbosity)}, %% Integer
{cover, $c, "cover", {boolean, false}, help(cover)},
+ {cover_export_name, undefined, "cover_export_name", string, help(cover_export_name)},
{repeat, undefined, "repeat", integer, help(repeat)}, %% integer
{duration, undefined, "duration", string, help(duration)}, % format: HHMMSS
{until, undefined, "until", string, help(until)}, %% format: YYMoMoDD[HHMMSS]
@@ -797,6 +802,8 @@ help(verbosity) ->
"Verbosity";
help(cover) ->
"Generate cover data";
+help(cover_export_name) ->
+ "Base name of the coverdata file to write";
help(repeat) ->
"How often to repeat tests";
help(duration) ->
diff --git a/src/rebar_prv_cover.erl b/src/rebar_prv_cover.erl
index 376ba72..7412038 100644
--- a/src/rebar_prv_cover.erl
+++ b/src/rebar_prv_cover.erl
@@ -392,10 +392,10 @@ redirect_cover_output(State, CoverPid) ->
[append]),
group_leader(F, CoverPid).
-write_coverdata(State, Task) ->
+write_coverdata(State, Name) ->
DataDir = cover_dir(State),
ok = filelib:ensure_dir(filename:join([DataDir, "dummy.log"])),
- ExportFile = filename:join([DataDir, atom_to_list(Task) ++ ".coverdata"]),
+ ExportFile = filename:join([DataDir, rebar_utils:to_list(Name) ++ ".coverdata"]),
case cover:export(ExportFile) of
ok ->
%% dump accumulated coverdata after writing
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl
index 2361432..4b71416 100644
--- a/src/rebar_prv_eunit.erl
+++ b/src/rebar_prv_eunit.erl
@@ -472,7 +472,8 @@ maybe_write_coverdata(State) ->
true -> rebar_state:set(State, cover_enabled, true);
false -> State
end,
- rebar_prv_cover:maybe_write_coverdata(State1, ?PROVIDER).
+ Name = proplists:get_value(cover_export_name, RawOpts, ?PROVIDER),
+ rebar_prv_cover:maybe_write_coverdata(State1, Name).
handle_results(ok) -> ok;
handle_results(error) ->
@@ -484,6 +485,7 @@ eunit_opts(_State) ->
[{app, undefined, "app", string, help(app)},
{application, undefined, "application", string, help(app)},
{cover, $c, "cover", boolean, help(cover)},
+ {cover_export_name, undefined, "cover_export_name", string, help(cover_export_name)},
{dir, $d, "dir", string, help(dir)},
{file, $f, "file", string, help(file)},
{module, $m, "module", string, help(module)},
@@ -495,6 +497,7 @@ eunit_opts(_State) ->
help(app) -> "Comma separated list of application test suites to run. Equivalent to `[{application, App}]`.";
help(cover) -> "Generate cover data. Defaults to false.";
+help(cover_export_name) -> "Base name of the coverdata file to write";
help(dir) -> "Comma separated list of dirs to load tests from. Equivalent to `[{dir, Dir}]`.";
help(file) -> "Comma separated list of files to load tests from. Equivalent to `[{file, File}]`.";
help(module) -> "Comma separated list of modules to load tests from. Equivalent to `[{module, Module}]`.";