rules 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/make -f
  2. %:
  3. dh $@
  4. ifneq ($(JENKINS_EXPORTS_DIR),)
  5. PYBUILD_EXTRA_ARGS = --junit-xml=$(JENKINS_EXPORTS_DIR)/test-results/tests.xml
  6. endif
  7. ifeq ($(RUN_COVERAGE),y)
  8. PYTEST_COV_OPTIONS = --cov-branch --cov --cov-report=
  9. endif
  10. override_dh_auto_test:
  11. ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
  12. ifneq ($(JENKINS_EXPORTS_DIR),)
  13. mkdir -pv $(JENKINS_EXPORTS_DIR)/test-results
  14. endif
  15. mkdir -p debian/test-gnupghome
  16. make -C tests/fixtures/packages
  17. GNUPGHOME=$$(pwd)/debian/test-gnupghome py.test -v $(PYTEST_COV_OPTIONS) daklib tests $(PYBUILD_EXTRA_ARGS)
  18. ifeq ($(RUN_COVERAGE),y)
  19. python-coverage combine --append
  20. endif
  21. ./integration-tests/run-tests
  22. ifeq ($(RUN_COVERAGE),y)
  23. python-coverage combine --append
  24. python-coverage report -m
  25. echo
  26. python-coverage html -d coverage
  27. endif
  28. endif
  29. # Replace with "debian/test-gnupghome/" in d/clean once
  30. # debhelper (>= 9.20151116) can be used for dak
  31. override_dh_auto_clean:
  32. make -C tests/fixtures/packages clean
  33. rm -fr debian/test-gnupghome
  34. dh_auto_clean