[libfann] 04/06: rules: Replace custom Python testing code with Pybuild
Christian Kastner
chrisk-guest at moszumanska.debian.org
Sun Oct 5 17:35:27 UTC 2014
This is an automated email from the git hooks/post-receive script.
chrisk-guest pushed a commit to branch master
in repository libfann.
commit 160c8deed7f0a2326d47c62d18c973d2603d73dc
Author: Christian Kastner <debian at kvr.at>
Date: Sun Oct 5 19:02:05 2014 +0200
rules: Replace custom Python testing code with Pybuild
Pybuild was already being used for the build and install stages, it seems only
natural to use it for the testing stage, too.
---
debian/rules | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/debian/rules b/debian/rules
index 648792a..00a6afb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,9 +10,6 @@ export DEB_CFLAGS_MAINT_APPEND = -Wall
# For pybuild
export PYBUILD_NAME=pyfann
-# List of supported Python versions
-PYVERS = $(shell pyversions -r -v)
-
%:
dh $@ --with autoreconf,python2
@@ -49,27 +46,28 @@ override_dh_auto_build-indep:
override_dh_auto_test-arch:
# Simulate partial autopkgtest run by providing an ADTTMP and setting
- # CPATH/LIBRARY_PATH resp. PYTHONPATH accordingly.
+ # CPATH/LIBRARY_PATH/LD_LIBRARY_PATH for the build test, and
+ # LD_LIBRARY_PATH/PYTHONPATH for the Python test.
+ #
+ # We don't create a separate $ADTTMP for all of the tests because it
+ # is not possible -- we only have one Pybuild command, but it may
+ # perform tests for more than one version, so we just manually clean it
+ # before each test using PYBUILD_BEFORE_TEST.
testrundir=$$(mktemp -d) ;\
ADTTMP=$$testrundir \
CPATH=$(CURDIR)/src/include \
LIBRARY_PATH=$(CURDIR)/src/.libs \
LD_LIBRARY_PATH=$(CURDIR)/src/.libs \
/bin/sh $(CURDIR)/debian/tests/build ;\
- res=$$? ;\
- rm -rf "$$testrundir" ;\
- [ $$res -eq 0 ] || exit $$res ;\
+ [ $$? -eq 0 ] || exit 1 ;\
\
- for py in $(PYVERS); do \
- testrundir=$$(mktemp -d) ;\
ADTTMP=$$testrundir \
- PYTHONPATH=$(CURDIR)/.pybuild/pythonX.Y_$$py/build/ \
- LD_LIBRARY_PATH=$(CURDIR)/src/.libs \
- /bin/sh $(CURDIR)/debian/tests/python-build ;\
- res=$$? ;\
- rm -rf "$$testrundir" ;\
- [ $$res -eq 0 ] || exit $$res ;\
- done
+ LD_LIBRARY_PATH=$(CURDIR)/src/.libs \
+ PYBUILD_SYSTEM=custom \
+ PYBUILD_BEFORE_TEST="cd $$ADTTMP && rm -rf *" \
+ PYBUILD_TEST_ARGS="PYINTERPRETER={interpreter} /bin/sh $(CURDIR)/debian/tests/python-build" ;\
+ du_auto_test --buildsystem=pybuild ;\
+ rm -rf "$$testrundir"
override_dh_auto_test-indep:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libfann.git
More information about the debian-science-commits
mailing list