Move test directory cleaning commands to a separate recipe
authorAfif Elghraoui <afif@ghraoui.name>
Fri, 24 Jul 2015 07:20:38 +0000 (00:20 -0700)
committerAfif Elghraoui <afif@ghraoui.name>
Fri, 24 Jul 2015 07:20:38 +0000 (00:20 -0700)
This allows us to be require a clean test directory before the
installation step. We don't want to package all the temporary
files that come with the tests being built.

debian/rules

index 23ef750cd37245a60b5d2f4274191f9925d1c288..0a7ac112feda574c88da5faf9e57022f86548e92 100755 (executable)
@@ -16,26 +16,11 @@ export PYBUILD_TEST_ARGS={dir}/tests
 %:
        LC_ALL=C.UTF-8 dh $@ --with python2,python3 --buildsystem=pybuild
 
-override_dh_install:
+override_dh_install: clean-tests
        dh_install -Xtest.gtf.gz
 
-override_dh_auto_clean:
+override_dh_auto_clean: clean-tests
        dh_auto_clean
-       $(MAKE) -C tests/pysam_data clean
-       find . -name "*.pyc" -delete
-       find . -name "*.pyxbldc" -delete
-       find . -name "tmp_*" -delete
-       find . -name "*.bai*" -delete
-       find . -name "*.cram*" -delete
-       find . -name "*.bam" -delete
-       rm -rf  tests/pysam_test_work \
-               tests/example_htslib.gtf.gz.tbi \
-               tests/log.txt \
-               tests/test.bam \
-               tests/_compile_test.c \
-               tests/pysam_ex2.sam \
-               pysam/calignmentfile.c \
-               pysam/cbcf.c
 
 override_dh_auto_test:
        # Tests are stumbling upon missing ex1.bam file ...
@@ -59,3 +44,22 @@ override_dh_auto_test:
 
 get-orig-source:
        uscan --verbose --force-download --repack --compression xz
+
+clean-tests:
+       $(MAKE) -C tests/pysam_data clean
+       find . -name "*.pyc" -delete
+       find . -name "*.pyxbldc" -delete
+       find . -name "tmp_*" -delete
+       find . -name "*.bai*" -delete
+       find . -name "*.cram*" -delete
+       find . -name "*.bam" -delete
+       rm -rf  tests/pysam_test_work \
+               tests/example_htslib.gtf.gz.tbi \
+               tests/log.txt \
+               tests/test.bam \
+               tests/_compile_test.c \
+               tests/pysam_ex2.sam \
+               pysam/calignmentfile.c \
+               pysam/cbcf.c
+
+.PHONY: clean-tests