Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test coverage #183

Merged
merged 2 commits into from
Dec 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ lib/
*.json
.lein-failures
doc/
cov/*
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ script:
# check fails because of "Duplicate Push instruction defined:boolean_and"
# - lein check
- lein test
after_success: ./scripts/after_success.sh 2>&1 | sed "s/$GITHUB_TOKEN/<hidden github token>/"
after_success:
- ./scripts/coveralls.sh
- ./scripts/after_success.sh 2>&1 | sed "s/$GITHUB_TOKEN/<hidden github token>/"
notifications:
email: false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Clojush [![Travis branch](https://img.shields.io/travis/lspector/Clojush/master.svg?style=flat-square)](https://travis-ci.org/lspector/Clojush) [![API Docs](https://img.shields.io/badge/api%20docs-master-blue.svg?style=flat-square)](http://lspector.github.io/Clojush/) [![Clojars Project](https://img.shields.io/clojars/v/clojush.svg?style=flat-square)](http://clojars.org/clojush)
Clojush [![Travis branch](https://img.shields.io/travis/lspector/Clojush/master.svg?style=flat-square)](https://travis-ci.org/lspector/Clojush) [![Coveralls branch](https://img.shields.io/coveralls/lspector/Clojush/master.svg?style=flat-square)](https://coveralls.io/github/lspector/Clojush) [![API Docs](https://img.shields.io/badge/api%20docs-master-blue.svg?style=flat-square)](http://lspector.github.io/Clojush/) [![Clojars Project](https://img.shields.io/clojars/v/clojush.svg?style=flat-square)](http://clojars.org/clojush)
=======


Expand Down
3 changes: 2 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
[clj-random "0.1.7"]]
:plugins [[lein-codox "0.9.1"]
[lein-shell "0.5.0"]
[lein-gorilla "0.3.5"]]
[lein-gorilla "0.3.5"]
[lein-cloverage "1.0.6"]]
:codox {:source-uri "http://github.com/lspector/Clojush/blob/master/{filepath}#L{line}"
:namespaces [#"^(?!clojush\.problems)"]
:output-path "doc"
Expand Down
19 changes: 19 additions & 0 deletions scripts/coveralls.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# based on http://bfontaine.net/blog/2014/02/15/using-coveralls-with-clojure/

set -o errexit
set -o nounset
set -o xtrace
set -o pipefail

# don't run problem tests with coverage, because they break it with
# duplicate instruction problems
PROBLEM_TESTS=test/clojush/midje/problems/
TMP_DIR=tmp_ignore/
mv $PROBLEM_TESTS $TMP_DIR

COVERALLS_URL='https://coveralls.io/api/v1/jobs'
lein cloverage -o cov --coveralls --ns-exclude-regex '^clojush[.]problems.*'
curl -F 'json_file=@cov/coveralls.json' "$COVERALLS_URL"

mv $TMP_DIR $PROBLEM_TESTS