Skip to content

Commit

Permalink
Merge pull request processone#516 from esl/cover-on-17.5
Browse files Browse the repository at this point in the history
Cover on 17.5
  • Loading branch information
ppikula committed Sep 28, 2015
2 parents bb4d480 + b95c3f3 commit 4b9498f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ branches:
- master

otp_release:
- R16B03
- 17.5
env:
- PRESET=internal_redis DB=mnesia REL_CONFIG=with-redis
- PRESET=internal_mnesia DB=mnesia
Expand All @@ -43,5 +43,5 @@ matrix:
include:
- otp_release: R15B03
env: PRESET=internal_mnesia DB=mnesia
- otp_release: 17.4
- otp_release: R16B03
env: PRESET=internal_mnesia DB=mnesia
37 changes: 30 additions & 7 deletions apps/ejabberd/rebar.config.script
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@

DisableCoverage = fun() ->
Opts = [{cover_enabled, false},
{cover_print_enabled, false},
{cover_export_enabled, false}],
lists:foldl(fun({Key, _}=Tuple, Acc) ->
lists:keyreplace(Key, 1, Acc, Tuple)
end, CONFIG, Opts)
end,

GetFullVer = fun() ->
Path = filename:join([code:root_dir(), "releases",
erlang:system_info(otp_release),
"OTP_VERSION"]),
{ok, BinString} = file:read_file(Path),
case re:replace(BinString, <<"\\s+">>, "", [global]) of
Version when is_binary(Version) ->
Version;
[Version | _] ->
Version
end
end,

case erlang:system_info(otp_release) of
"17" ->
io:format("disabling coverage for OTP 17~n"),
Opts = [{cover_enabled, false},
{cover_print_enabled, false},
{cover_export_enabled, false}],
lists:foldl(fun({Key, _}=Tuple, Acc) ->
lists:keyreplace(Key, 1, Acc, Tuple)
end, CONFIG, Opts);
case catch GetFullVer() of
<<"17.5">> -> % This is 17.5 where cover was fixed
CONFIG;
_ ->
io:format("disabling coverage for OTP 17.0 to 17.4~n"),
DisableCoverage()
end;
_ ->
CONFIG
end.

0 comments on commit 4b9498f

Please sign in to comment.