[Python-apps-commits] r6952 - in packages/veusz/trunk/debian (3 files)
jeremysanders-guest at users.alioth.debian.org
jeremysanders-guest at users.alioth.debian.org
Mon Apr 18 20:34:59 UTC 2011
Date: Monday, April 18, 2011 @ 20:34:56
Author: jeremysanders-guest
Revision: 6952
Implement self test in package building
Added:
packages/veusz/trunk/debian/patches/self-test-data-location.patch
Modified:
packages/veusz/trunk/debian/patches/series
packages/veusz/trunk/debian/rules
Added: packages/veusz/trunk/debian/patches/self-test-data-location.patch
===================================================================
--- packages/veusz/trunk/debian/patches/self-test-data-location.patch (rev 0)
+++ packages/veusz/trunk/debian/patches/self-test-data-location.patch 2011-04-18 20:34:56 UTC (rev 6952)
@@ -0,0 +1,20 @@
+Description: Monkey patch location of Veusz data files while running self-test
+ .
+ This is required because we change the data file locations in
+ datafiles-usr-share.patch
+Author: Jeremy Sanders <jeremy at jeremysanders.net>
+Forwarded: not-needed
+--- veusz-1.11.orig/tests/runselftest.py
++++ veusz-1.11/tests/runselftest.py
+@@ -41,6 +41,11 @@
+ import os.path
+ import sys
+
++import veusz.utils
++datadir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
++veusz.utils.veuszDirectory = veusz.utils.utilfuncs.veuszDirectory = datadir
++veusz.utils.action.imagedir = os.path.join(datadir, 'windows', 'icons')
++
+ import veusz.qtall as qt4
+ import veusz.utils.textrender
+ import veusz.document as document
Modified: packages/veusz/trunk/debian/patches/series
===================================================================
--- packages/veusz/trunk/debian/patches/series 2011-04-18 20:25:32 UTC (rev 6951)
+++ packages/veusz/trunk/debian/patches/series 2011-04-18 20:34:56 UTC (rev 6952)
@@ -1,2 +1,3 @@
license-file-location.patch
datafiles-usr-share.patch
+self-test-data-location.patch
Modified: packages/veusz/trunk/debian/rules
===================================================================
--- packages/veusz/trunk/debian/rules 2011-04-18 20:25:32 UTC (rev 6951)
+++ packages/veusz/trunk/debian/rules 2011-04-18 20:34:56 UTC (rev 6952)
@@ -1,5 +1,12 @@
#!/usr/bin/make -f
+# Get the supported Python versions
+PYVERS = $(shell pyversions -r -v)
+
+# Callable functions to determine the correct PYTHONPATH
+pythonpath = $$(ls -d $(CURDIR)/build/lib.*-$(1))
+pythonpath_dbg = $$(ls -d $(CURDIR)/build/lib_d.*-$(1) 2>/dev/null || ls -d $(CURDIR)/lib.*$(1)-pydebug)
+
%:
dh $@ --with python2
@@ -11,6 +18,19 @@
# -- --force works around bug #589759
dh_auto_build -- --force
+override_dh_auto_test:
+ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+ set -e -x;\
+ for py in $(PYVERS); do \
+ PYTHONPATH=$(call pythonpath,$$py) xvfb-run \
+ --server-args "-screen 0 640x480x24" \
+ python$$py tests/runselftest.py ;\
+ PYTHONPATH=$(call pythonpath_dbg,$$py) xvfb-run \
+ --server-args "-screen 0 640x480x24" \
+ python$$py-dbg tests/runselftest.py ;\
+ done
+endif
+
override_dh_strip:
dh_strip --dbg-package=veusz-helpers-dbg
More information about the Python-apps-commits
mailing list