Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMickael Remond <mremond@process-one.net>2016-03-21 14:01:20 +0300
committerMickael Remond <mremond@process-one.net>2016-03-21 14:01:20 +0300
commitef04dd75aa91793cd5fb8c87265c0b5214e0b575 (patch)
tree971550dad66886a2636ffbeee2d2d0b0f99c5d61 /rebar.config.script
parent3441157a38e571ae1b29787e8f623000e630cb7c (diff)
Add Coveralls support
Diffstat (limited to 'rebar.config.script')
-rw-r--r--rebar.config.script27
1 files changed, 26 insertions, 1 deletions
diff --git a/rebar.config.script b/rebar.config.script
index a7120b12a..909284204 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -7,6 +7,20 @@
%%% Created : 1 May 2013 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%%-------------------------------------------------------------------
+ModCfg0 = fun(F, Cfg, [Key|Tail], Op, Default) ->
+ {OldVal,PartCfg} = case lists:keytake(Key, 1, Cfg) of
+ {value, {_, V1}, V2} -> {V1, V2};
+ false -> {if Tail == [] -> Default; true -> [] end, Cfg}
+ end,
+ case Tail of
+ [] ->
+ [{Key, Op(OldVal)} | PartCfg];
+ _ ->
+ [{Key, F(F, OldVal, Tail, Op, Default)} | PartCfg]
+ end
+ end,
+ModCfg = fun(Cfg, Keys, Op, Default) -> ModCfg0(ModCfg0, Cfg, Keys, Op, Default) end.
+
Cfg = case file:consult(filename:join(filename:dirname(SCRIPT), "vars.config")) of
{ok, Terms} ->
Terms;
@@ -107,9 +121,20 @@ Conf5 = case lists:keytake(floating_deps, 1, Conf3) of
Conf3
end,
+%% When running Travis test, upload test coverage result to coveralls:
+Conf6 = case os:getenv("TRAVIS") of
+ "true" ->
+ JobId = os:getenv("TRAVIS_JOB_ID"),
+ CfgTemp = ModCfg(Conf5, [deps], fun(V) -> [{coveralls, ".*", {git, "https://github.com/markusn/coveralls-erl.git", "master"}}|V] end, []),
+ ModCfg(CfgTemp, [post_hooks], fun(V) -> V ++ [{ct, "echo '\n%%! -pa ebin/ deps/coveralls/ebin\nmain(_)->{ok,F}=file:open(\"erlang.json\",[write]),io:fwrite(F,\"~s\",[coveralls:convert_file(\"logs/all.coverdata\", \""++JobId++"\", \"travis-ci\")]).' > getcover.erl"},
+ {ct, "escript ./getcover.erl"}] end, []);
+ _ ->
+ Conf5
+ end,
+
%io:format("ejabberd configuration:~n ~p~n", [Conf5]),
-Conf5.
+Conf6.
%% Local Variables:
%% mode: erlang