Permalink
Browse files

Add coveralls

  • Loading branch information...
lpgauth committed Feb 9, 2016
1 parent 5686bc2 commit 6620dec1634f54ce84f381f49729b6d82fc131d7
Showing with 40 additions and 16 deletions.
  1. +1 −1 .gitignore
  2. +1 −1 .travis.yml
  3. +16 −10 Makefile
  4. +15 −4 rebar.config
  5. +7 −0 rebar.config.script
View
@@ -1,4 +1,4 @@
*.beam
doc/README.md
erl_crash.dump
fprofx.*
_build
View
@@ -9,5 +9,5 @@ notifications:
otp_release:
- 18.0
- 17.5
script: "make test"
script: "make travis"
sudo: false
View
@@ -1,47 +1,53 @@
CACHEGRIND=qcachegrind
ELVIS=./bin/elvis
REBAR=./bin/rebar3
REBAR3=./bin/rebar3
all: compile
clean:
@echo "Running rebar3 clean..."
@$(REBAR) clean -a
@$(REBAR3) clean -a
compile:
@echo "Running rebar3 compile..."
@$(REBAR) as build compile
@$(REBAR3) as compile compile
coveralls:
@echo "Running rebar3 coveralls send..."
@$(REBAR3) as test coveralls send
dialyzer:
@echo "Running rebar3 dialyze..."
@$(REBAR) dialyzer
@$(REBAR3) dialyzer
edoc:
@echo "Running rebar3 edoc..."
@$(REBAR) edoc
@$(REBAR3) as edoc edoc
elvis:
@echo "Running elvis rock..."
@$(ELVIS) rock
eunit:
@echo "Running rebar3 eunit..."
@$(REBAR) do eunit -cv, cover -v
@$(REBAR3) do eunit -cv, cover -v
profile:
@echo "Profiling..."
@$(REBAR) as test compile
@$(REBAR3) as test compile
@erl -noshell \
-pa _build/test/lib/*/ebin \
-eval 'statsderl_profile:fprofx()' \
-eval 'init:stop()'
@_build/test/lib/fprofx/erlgrindx -p fprofx.analysis
@$(CACHEGRIND) fprofx.cgrind
test: compile dialyzer elvis eunit xref
test: elvis xref eunit dialyzer
travis: test coveralls
xref:
@echo "Running rebar3 xref..."
@$(REBAR) xref
@$(REBAR3) xref
.PHONY: clean compile dialyzer edoc elvis eunit profile xref
.PHONY: clean compile coveralls dialyzer edoc elvis eunit profile xref
View
@@ -1,3 +1,7 @@
{cover_export_enabled, true}.
{coveralls_coverdata, "_build/test/cover/eunit.coverdata"}.
{coveralls_service_name, "travis-ci"}.
{edoc_opts, [
{app_default, "http://www.erlang.org/doc/man"},
{doclet, edown_doclet},
@@ -13,7 +17,7 @@
]}.
{profiles, [
{build, [
{compile, [
{erl_opts, [
warnings_as_errors,
warn_export_all,
@@ -28,13 +32,20 @@
]},
{docs, [
{deps, [
{edown, {git, "https://github.com/uwiger/edown.git", {tag, "0.7"}}}
{edown,
{git, "https://github.com/uwiger/edown.git", {tag, "0.7"}}}
]}
]},
{test, [
{deps, [
{meck, {git, "https://github.com/eproxus/meck.git", {tag, "0.8.3"}}},
{fprofx, {git, "https://github.com/ransomr/fprofx.git", {branch, "master"}}}
{meck,
{git, "https://github.com/eproxus/meck.git", {tag, "0.8.3"}}},
{fprofx,
{git, "https://github.com/ransomr/fprofx.git", {branch, "master"}}}
]},
{plugins, [
{coveralls,
{git, "https://github.com/markusn/coveralls-erl", {branch, "master"}}}
]},
{src_dirs, ["src", "test"]}
]}
View
@@ -0,0 +1,7 @@
case os:getenv("TRAVIS") of
"true" ->
JobId = os:getenv("TRAVIS_JOB_ID"),
lists:keystore(coveralls_service_job_id, 1, CONFIG, {coveralls_service_job_id, JobId});
_ ->
CONFIG
end.

0 comments on commit 6620dec

Please sign in to comment.