Bug#781996: openblas: Please consider adding autopkgtest support

Christian Kastner debian at kvr.at
Mon Apr 6 09:48:13 UTC 2015


Source: openblas
Version: 0.2.12-1
Severity: wishlist
Tags: patch

Hi,

the attached debdiff adds autopkgtest support to openblas. Please
consider including it in your package.

It adds one test "upstream-testsuite". This test copies away the
upstream build-time test suite (and any other necessary files) to a
temporary directory, and then trivially modifies them to test the
locally installed binaries instead.

This can be used for eg: ci.debian.net to automatically re-test the
package when one of its dependencies changes, or to re-test the package
and its reverse-dependencies when the package itself changes (new
upstream release, etc.).

For example, to test the binaries you have installed on your local
machine, all you have to do is execute

    $ adt-run -B --source openblas_0.2.12-1.1.dsc -- adt-virt-null

Thanks!
Christian


-------------- next part --------------
diff -Nru openblas-0.2.12/debian/changelog openblas-0.2.12/debian/changelog
--- openblas-0.2.12/debian/changelog	2014-10-26 10:42:35.000000000 +0100
+++ openblas-0.2.12/debian/changelog	2015-04-06 09:38:22.000000000 +0200
@@ -1,3 +1,13 @@
+openblas (0.2.12-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add autopkgtest support:
+    - Add XS-Testsuite to debian/control
+    - Add test "upstream-testsuite" which runs upstream build-time tests,
+      adapted to test the installed binaries instead
+
+ -- Christian Kastner <debian at kvr.at>  Wed, 01 Apr 2015 21:38:58 +0200
+
 openblas (0.2.12-1) unstable; urgency=medium
 
   * Imported Upstream version 0.2.12. (Closes: #765795)
diff -Nru openblas-0.2.12/debian/control openblas-0.2.12/debian/control
--- openblas-0.2.12/debian/control	2014-09-27 20:25:35.000000000 +0200
+++ openblas-0.2.12/debian/control	2015-04-01 21:33:37.000000000 +0200
@@ -9,6 +9,7 @@
 Homepage: https://github.com/xianyi/OpenBLAS
 Vcs-Git: git://anonscm.debian.org/debian-science/packages/openblas.git
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/openblas.git
+XS-Testsuite: autopkgtest
 
 Package: libopenblas-base
 Section: libs
diff -Nru openblas-0.2.12/debian/tests/control openblas-0.2.12/debian/tests/control
--- openblas-0.2.12/debian/tests/control	1970-01-01 01:00:00.000000000 +0100
+++ openblas-0.2.12/debian/tests/control	2015-04-06 09:47:37.000000000 +0200
@@ -0,0 +1,3 @@
+Tests: upstream-testsuite
+Restrictions: allow-stderr
+Depends: @, gfortran
diff -Nru openblas-0.2.12/debian/tests/upstream-testsuite openblas-0.2.12/debian/tests/upstream-testsuite
--- openblas-0.2.12/debian/tests/upstream-testsuite	1970-01-01 01:00:00.000000000 +0100
+++ openblas-0.2.12/debian/tests/upstream-testsuite	2015-04-01 21:37:24.000000000 +0200
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Execute upstream's testsuite against the installed binaries.
+
+set -e
+
+if [ -z "$ADTTMP" ]
+then
+	echo "Temporary directory \$ADTTMP is not set. Aborting" >&2
+	exit 1
+fi
+
+# Work from $ADTTMP as we need to treat the original source as read-only
+cp -a test Makefile* ?_check cpuid* ctest* getarch* param.h "$ADTTMP"/
+cd "$ADTTMP"/test
+
+# Make tests use the installed binaries instead of using the build result path
+sed -i -e 's,\.\./\$(LIBNAME),,g' Makefile
+sed -i -e 's,CEXTRALIB =,CEXTRALIB = -lopenblas -lpthread,' Makefile
+
+# Execute tests
+make
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/debian-science-maintainers/attachments/20150406/198ddc06/attachment.sig>


More information about the debian-science-maintainers mailing list