Package: python-numpy
Version: 1:1.7.0~b2-1
Severity: wishlist

attached a patch that adds dep8 autopkgtests.
it runs the upstream testsuite against the installed package, tests the
blas alternatives and runs a f2py smoketest
From 9f7ac1aeefd7d8c71742c7658bffca43d0e3fce7 Mon Sep 17 00:00:00 2001
From: Julian Taylor <jtaylor.deb...@googlemail.com>
Date: Thu, 13 Dec 2012 23:21:36 +0100
Subject: [PATCH] add autopkgtests

---
 debian/control        |    1 +
 debian/tests/atlas    |    1 +
 debian/tests/control  |   14 ++++++++++++++
 debian/tests/f2py     |   23 +++++++++++++++++++++++
 debian/tests/openblas |   10 ++++++++++
 debian/tests/python2  |   12 ++++++++++++
 debian/tests/python3  |   12 ++++++++++++
 7 files changed, 73 insertions(+)
 create mode 120000 debian/tests/atlas
 create mode 100644 debian/tests/control
 create mode 100755 debian/tests/f2py
 create mode 100755 debian/tests/openblas
 create mode 100755 debian/tests/python2
 create mode 100755 debian/tests/python3

diff --git a/debian/control b/debian/control
index 9737bc1..499112e 100644
--- a/debian/control
+++ b/debian/control
@@ -10,6 +10,7 @@ Standards-Version: 3.9.3
 Vcs-Svn: svn://svn.debian.org/python-modules/packages/numpy/trunk
 Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/numpy/trunk/
 Homepage: http://numpy.scipy.org/
+XS-Testsuite: autopkgtest
 
 Package: python-numpy
 Architecture: any
diff --git a/debian/tests/atlas b/debian/tests/atlas
new file mode 120000
index 0000000..6d65db3
--- /dev/null
+++ b/debian/tests/atlas
@@ -0,0 +1 @@
+openblas
\ No newline at end of file
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..5ef860b
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,14 @@
+Tests: python2
+Depends: python-numpy, python-all, python-nose, python-tz
+
+Tests: python3
+Depends: python3-numpy, python3-all, python3-nose, python3-tz
+
+Tests: openblas
+Depends: python-numpy, python-all, python-nose, python-tz, libopenblas-base
+
+Tests: atlas
+Depends: python-numpy, python-all, python-nose, python-tz, libatlas3-base
+
+Tests: f2py
+Depends: gfortran, python-numpy, python-numpy-dbg, python-all, python-all-dbg, python-all-dev, python3-numpy, python3-numpy-dbg, python3-all, python3-all-dbg, python3-all-dev
diff --git a/debian/tests/f2py b/debian/tests/f2py
new file mode 100755
index 0000000..afbd8b7
--- /dev/null
+++ b/debian/tests/f2py
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -efu
+
+PYS=$(pyversions -rv 2>/dev/null)" "$(py3versions -rv 2>/dev/null)
+
+cd "$ADTTMP"
+
+cat << EOF > hello.f
+C File hello.f
+      integer function foo (a)
+      integer a
+      foo = a + 1
+      end
+EOF
+
+for py in " " 3 $PYS; do
+    [ "$py" = " " ] && py=""
+    echo "=== f2py$py ==="
+    f2py$py -c -m hello hello.f 2>&1
+    python -c 'import hello; assert hello.foo(4) == 5'
+    f2py$py-dbg -c -m hello hello.f 2>&1
+    python -c 'import hello; assert hello.foo(4) == 5'
+done
diff --git a/debian/tests/openblas b/debian/tests/openblas
new file mode 100755
index 0000000..211eee6
--- /dev/null
+++ b/debian/tests/openblas
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -efu
+readlink -f /usr/lib/libblas.so.3 2>&1 || true
+
+# one python is enough
+PYS=${PYS:-"$(pyversions -d 2>/dev/null)"}
+
+#test only modules that link against libblas
+PYS=$PYS TESTPKG=numpy.core debian/tests/python2
+PYS=$PYS TESTPKG=numpy.linalg debian/tests/python2
diff --git a/debian/tests/python2 b/debian/tests/python2
new file mode 100755
index 0000000..481e90c
--- /dev/null
+++ b/debian/tests/python2
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -efu
+
+PYS=${PYS:-"$(pyversions -r 2>/dev/null)"}
+TESTPKG=${TESTPKG:-numpy}
+
+cd "$ADTTMP"
+
+for py in $PYS; do
+    echo "=== $py ==="
+    $py -c "import $TESTPKG; $TESTPKG.test(verbose=2)" 2>&1
+done
diff --git a/debian/tests/python3 b/debian/tests/python3
new file mode 100755
index 0000000..5586302
--- /dev/null
+++ b/debian/tests/python3
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -efu
+
+PYS=${PYS:-"$(py3versions -r 2>/dev/null)"}
+TESTPKG=${TESTPKG:-numpy}
+
+cd "$ADTTMP"
+
+for py in $PYS; do
+    echo "=== $py ==="
+    $py -c "import $TESTPKG; $TESTPKG.test(verbose=2)" 2>&1
+done
-- 
1.7.10.4

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to