Makefile 570 B

1234567891011121314151617181920212223
  1. TEST_OPTIONS := --failfast --catch
  2. COVERAGE_OPTIONS := --branch
  3. COVERAGE_DIR := coverage
  4. .PHONY: test coverage pyclean clean
  5. test:
  6. @PYTHONDONTWRITEBYTECODE=x python -m unittest discover -s tests \
  7. -p 'test_*.py' $(TEST_OPTIONS)
  8. coverage:
  9. @python-coverage erase
  10. @rm -rf $(COVERAGE_DIR)
  11. @PYTHONDONTWRITEBYTECODE=x PYTHONPATH=. python-coverage run --source=. \
  12. --omit=tests/* $(COVERAGE_OPTIONS) tests/run.py
  13. @python-coverage report
  14. @python-coverage html --directory=$(COVERAGE_DIR)
  15. pyclean:
  16. find -name \*.pyc -delete
  17. clean: pyclean
  18. rm -rf $(COVERAGE_DIR)