diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000000..a072f4d6db --- /dev/null +++ b/.coveragerc @@ -0,0 +1,9 @@ +[run] +omit = + tests/* + translate/test_* + translate/*/test_* + translate/*/*/test_* + translate/misc/diff_match_patch.py + translate/misc/selector.py + translate/misc/wsgiserver/* diff --git a/.gitignore b/.gitignore index 118b9ef427..d5d10f8e9a 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ tests/xliff_conformance/af-pootle.xlf # Requirements generation .reqs + +# Coverage +.coverage* diff --git a/.travis.yml b/.travis.yml index 06c82d7fe5..3146ec3a5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ matrix: before_install: - sudo apt-get install python-aeidon install: + - pip install coveralls - if [[ $MINVERSION ]]; then rm min-required.txt; make min-required.txt; pip install -r min-required.txt; pip install --upgrade pytest; fi - if [[ ! $MINVERSION ]]; then pip install -r requirements/dev.txt; fi - if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then pip install --upgrade --pre lxml; fi @@ -30,10 +31,12 @@ script: # Compile all the files - python -m compileall -q -f . - python setup.py --quiet build - - py.test --boxed -r EfsxX + - py.test --boxed --cov=. -r EfsxX - ./tools/pep8.sh travis # -W report warnings as errors when building docs - - cd docs; make SPHINXOPTS=-W html + - cd docs; make SPHINXOPTS=-W html; cd .. +after_success: + coveralls notifications: email: on_failure: always diff --git a/README.rst b/README.rst index de78950779..47401a1657 100644 --- a/README.rst +++ b/README.rst @@ -4,6 +4,9 @@ Translate Toolkit .. image:: https://travis-ci.org/translate/translate.png :alt: Build Status :target: https://travis-ci.org/translate/translate +.. image:: https://coveralls.io/repos/translate/translate/badge.png?branch=master + :alt: Coverage Status + :target: https://coveralls.io/r/translate/translate?branch=master The Translate Toolkit is a set of software and documentation designed to help make the lives of localizers both more productive and less frustrating. diff --git a/requirements/dev.txt b/requirements/dev.txt index c6a3c611de..2f01d1474e 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,6 +1,7 @@ -r optional.txt pytest>=2.2 +pytest-cov pytest-xdist Sphinx>=1.2.0 pep8