Skip to content

Commit

Permalink
Merge pull request #60 from surik/coverall
Browse files Browse the repository at this point in the history
Add code coverage
  • Loading branch information
Dmitry Aleksandrov(Russ) committed Aug 5, 2015
2 parents 76b1709 + 437748b commit e94a98b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
before_install:
- sudo apt-get update -qq
- sudo apt-get install avahi-daemon libavahi-compat-libdnssd-dev
- sudo apt-get update -qq
- sudo apt-get install avahi-daemon libavahi-compat-libdnssd-dev
- wget https://github.com/rebar/rebar/wiki/rebar
- chmod u+x ./rebar
language: erlang
otp_release:
- 17.4
script: "rebar get-deps compile && rebar ct skip_deps=true"
- 17.5
- 18.0
script: "./rebar compile && ./rebar ct skip_deps=true"
after_failure: "cat logs/raw.log"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hello [![Build Status](https://travis-ci.org/travelping/hello.svg)](https://travis-ci.org/travelping/hello)
# Hello [![Build Status](https://travis-ci.org/travelping/hello.svg)](https://travis-ci.org/travelping/hello) [![Coverage Status](https://coveralls.io/repos/travelping/hello/badge.svg?branch=coverall&service=github)](https://coveralls.io/github/travelping/hello?branch=coverall)

Hello is a pragmatic RPC toolkit for Erlang.
It enables you to rapidly create rich RPC services.
Expand Down
2 changes: 2 additions & 0 deletions cover.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{incl_app, hello, details}.
{export, "logs/all.coverdata"}.
6 changes: 5 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
{msgpack, ".*", {git, "git://github.com/msgpack/msgpack-erlang.git", {branch, master}}},
{dnssd, ".*", {git, "git://github.com/benoitc/dnssd_erlang.git", {branch, master}}},
{meck, ".*", {git, "git://github.com/eproxus/meck.git", {branch, master}}},
{exometer_core, ".*", {git, "git://github.com/Feuerlabs/exometer_core", {branch, "master"}}}
{exometer_core, ".*", {git, "git://github.com/Feuerlabs/exometer_core", {branch, "master"}}},
{coveralls, ".*", {git, "git://github.com/markusn/coveralls-erl.git", {branch, "master"}}}
% {tetrapak_yang, ".*", {git, "git://github.com/travelping/tetrapak_yang.git", {branch, master}}}
]}.

{cover_enabled, true}.
{cover_export_enabled, true}.
13 changes: 12 additions & 1 deletion rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,16 @@ case erlang:function_exported(rebar3, version, 0) of
end, proplists:get_value(deps, CONFIG1), HexDeps),
CONFIG2 = lists:keyreplace(deps, 1, CONFIG1, {deps, NewDeps}),
CONFIG2 ++ [ {provider_hooks, [{pre, [ {ct, {yang, compile}} ]} ]}] ++ [Overrides];
false -> CONFIG
false ->
case os:getenv("TRAVIS") of
"true" ->
JobId = os:getenv("TRAVIS_JOB_ID"),
CONFIG1 = lists:keystore(coveralls_service_job_id, 1, CONFIG, {coveralls_service_job_id, JobId}),
{value, {plugins, Plugins}} = lists:keysearch(plugins, 1, CONFIG1),
lists:keystore(plugins, 1, CONFIG1, {plugins, Plugins ++ [rebar_coveralls]})
++ [{coveralls_coverdata, "logs/all.coverdata"},
{coveralls_service_name, "travis-ci"},
{plugin_dir, "deps/coveralls/src"}];
_ -> CONFIG
end
end.

0 comments on commit e94a98b

Please sign in to comment.