From: Afif Elghraoui Date: Mon, 20 Jun 2016 01:12:23 +0000 (-0700) Subject: Rely more on pybuild for build-time tests X-Git-Tag: archive/raspbian/0.22.0+ds-1+rpi1~1^2^2~220 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=846ad26baaf7d798407bffd51b8e9a245bae4433;p=python-pysam.git Rely more on pybuild for build-time tests --- 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