[med-svn] [mapdamage] 02/04: Add simple autopkgtest

Andreas Tille tille at debian.org
Thu Dec 22 15:34:59 UTC 2016


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository mapdamage.

commit dc0d7bf3bf73f555e2683e8c8ac72935b7cf51f5
Author: Andreas Tille <tille at debian.org>
Date:   Thu Dec 22 16:26:55 2016 +0100

    Add simple autopkgtest
---
 debian/README.test         |  8 ++++++++
 debian/changelog           |  8 ++++++++
 debian/docs                |  2 ++
 debian/install             |  1 +
 debian/rules               |  8 ++++++++
 debian/tests/control       |  3 +++
 debian/tests/run-unit-test | 14 ++++++++++++++
 7 files changed, 44 insertions(+)

diff --git a/debian/README.test b/debian/README.test
new file mode 100644
index 0000000..39fbde9
--- /dev/null
+++ b/debian/README.test
@@ -0,0 +1,8 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by executing
+
+    sh run-unit-test
+
+in order to confirm its integrity.
diff --git a/debian/changelog b/debian/changelog
index 7319be9..08419d4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+mapdamage (2.0.6+dfsg-2) UNRELEASED; urgency=medium
+
+  * Add simple autopkgtest
+    Closes: #848326
+  * Spelling
+
+ -- Andreas Tille <tille at debian.org>  Thu, 22 Dec 2016 16:12:48 +0100
+
 mapdamage (2.0.6+dfsg-1) unstable; urgency=medium
 
   * Initial release (Closes: #833387)
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..9a4f4f8
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,2 @@
+debian/README.test
+debian/tests/run-unit-test
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..4ca7fcb
--- /dev/null
+++ b/debian/install
@@ -0,0 +1 @@
+mapdamage/rescale_test	usr/share/doc/mapdamage/tests
diff --git a/debian/rules b/debian/rules
index 57d25ee..4f03e78 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,6 +1,8 @@
 #!/usr/bin/make -f
 
 # DH_VERBOSE := 1
+DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
+TESTDIR        := debian/$(DEBPKGNAME)/usr/share/doc/$(DEBPKGNAME)/tests
 
 %:
 	dh $@ --with python2
@@ -9,3 +11,9 @@ override_dh_fixperms:
 	dh_fixperms
 	find debian -name checkLibraries.R -exec chmod +x \{\} \;
 	find debian -name runGeneral.R     -exec chmod +x \{\} \;
+
+override_dh_install:
+	dh_install
+	mv `find debian -name rescale_test.py` $(TESTDIR)
+	sed -i 's/^import rescale/from mapdamage &/' $(TESTDIR)/rescale_test.py
+	
\ No newline at end of file
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..25377fc
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @, r-cran-runit
+Restrictions: allow-stderr
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
new file mode 100644
index 0000000..53032cd
--- /dev/null
+++ b/debian/tests/run-unit-test
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+
+pkg=mapdamage
+
+if [ "$ADTTMP" = "" ] ; then
+  ADTTMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  trap "rm -rf $ADTTMP" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cd $ADTTMP
+
+cp -a /usr/share/doc/${pkg}/tests/* .
+gunzip -r *
+python rescale_test.py

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/mapdamage.git



More information about the debian-med-commit mailing list