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
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
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
tests/__pycache__ \
pysam/calignmentfile.c \
pysam/cbcf.c
-
-.PHONY: clean-tests