[med-svn] [python-pysam] 11/13: Rely more on pybuild for build-time tests

Afif Elghraoui afif at moszumanska.debian.org
Mon Jun 20 01:53:29 UTC 2016


This is an automated email from the git hooks/post-receive script.

afif pushed a commit to branch master
in repository python-pysam.

commit 846ad26baaf7d798407bffd51b8e9a245bae4433
Author: Afif Elghraoui <afif at debian.org>
Date:   Sun Jun 19 18:12:23 2016 -0700

    Rely more on pybuild for build-time tests
---
 debian/rules | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/debian/rules b/debian/rules
index c0e5f84..357ac52 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,7 +13,15 @@ export HTSLIB_LIBRARY_DIR=$(HTSLIBDIR)
 export HTSLIB_INCLUDE_DIR=/usr/include
 
 export PYBUILD_TEST_NOSE=1
-export PYBUILD_TEST_ARGS={dir}/tests
+# pybuild calls nosetests as `python{version} -m nose tests`
+#
+# The "tests" argument (passed by pybuild as shown above) fails,
+# so don't pass anything:
+export PYBUILD_TEST_ARGS=
+# This is how we pass parameters to nose without command-line flags
+export NOSE_WHERE=$(CURDIR)/tests
+export NOSE_VERBOSE=2
+export NOSE_NOCAPTURE=1
 
 # DEB_BUILD_OPTIONS := nocheck
 
@@ -24,15 +32,8 @@ clean: clean-tests
 override_dh_install: clean-tests
 	dh_install -Xtest.gtf.gz
 
-override_dh_auto_test:
-	cd tests && make -C pysam_data
-	cd tests/cbcf_data && make
-	# dh_auto_test	# unfortunately this does not work out of the box
-			# see https://lists.debian.org/debian-python/2015/07/msg00064.html
-			# thus trying manually with unusual tricks
-	PYBUILD_SYSTEM=custom \
-	PYBUILD_TEST_ARGS="cd tests && if [ {version} = 2.7 ] ; then nosetests -s ; else nosetests3 -s -v ; fi" dh_auto_test || \
-		echo "Ignoring test failures"
+override_dh_auto_test: pysam_data.all cbcf_data.all
+	dh_auto_test
 
 get-orig-source:
 	uscan --verbose --force-download --repack --compression xz
@@ -44,8 +45,14 @@ override_dh_auto_clean:
 		pysam/config.h \
 		samtools/config.h
 
-clean-tests:
-	$(MAKE) -C tests/pysam_data clean
+.PHONY: pysam_data.% cbcf_data.%
+cbcf_data.%:
+	cd tests/$(basename $@) && $(MAKE) $*
+pysam_data.%:
+	cd tests/$(basename $@) && $(MAKE) $*
+
+.PHONY: clean-tests
+clean-tests: pysam_data.clean cbcf_data.clean
 	find . -name "*.pyc" -delete
 	find . -name "*.pyxbldc" -delete
 	find . -name "tmp_*" -delete
@@ -61,5 +68,3 @@ clean-tests:
 		tests/__pycache__ \
 		pysam/calignmentfile.c \
 		pysam/cbcf.c
-
-.PHONY: clean-tests

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-pysam.git



More information about the debian-med-commit mailing list