diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000..6965bba
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,11 @@
+[report]
+exclude_lines =
+ def __repr__
+ raise NotImplementedError
+ raise MissingDependency
+ except xapian.DatabaseModifiedError
+
+[run]
+source =
+ haystack/backends/xapian_backend.py
+ test_haystack/xapian_tests
diff --git a/.travis.yml b/.travis.yml
index 41ba1eb..8ec222a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,14 +14,18 @@ install:
- git clone https://github.com/toastdriven/django-haystack.git
- sudo apt-get install -qq libxapian22 xapian-tools python-xapian
- ln -s /usr/lib/python2.7/dist-packages/xapian $VIRTUAL_ENV/lib/python2.7/site-packages/.
+ - pip install coveralls
# move xapian-haystack to django-haystack
before_script:
- cp xapian-haystack/xapian_backend.py django-haystack/haystack/backends
- cp -r xapian-haystack/tests/* django-haystack/test_haystack/
- cp xapian-haystack/tests/xapian_tests/__init__.py django-haystack/test_haystack/
+ - cp xapian-haystack/.coveragerc django-haystack/
# command to run tests
script:
- cd django-haystack/
- - PYTHONPATH=`pwd` django-admin.py test test_haystack.xapian_tests --settings=test_haystack.xapian_settings
+ - PYTHONPATH=`pwd` coverage run `which django-admin.py` test test_haystack.xapian_tests --settings=test_haystack.xapian_settings
+
+after_success: coveralls
diff --git a/README.rst b/README.rst
index 28ff581..66d205b 100644
--- a/README.rst
+++ b/README.rst
@@ -5,6 +5,8 @@ Xapian backend for Django-Haystack
.. image:: https://travis-ci.org/notanumber/xapian-haystack.svg?branch=master
:target: https://travis-ci.org/notanumber/xapian-haystack
+.. image:: https://coveralls.io/repos/notanumber/xapian-haystack/badge.svg?branch=master&service=github
+ :target: https://coveralls.io/github/notanumber/xapian-haystack?branch=master
Xapian-haystack is a backend of `Django-Haystack `_
for the `Xapian `_ search engine.