[med-svn] [toppred] 01/02: Add tests

Andreas Tille tille at debian.org
Sat Jan 31 15:52:25 UTC 2015


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

tille pushed a commit to branch master
in repository toppred.

commit 37f4e907aab9e704e1e287c6c768acbdd159b500
Author: Andreas Tille <tille at debian.org>
Date:   Sat Jan 31 15:55:14 2015 +0100

    Add tests
---
 debian/examples            |  2 ++
 debian/rules               |  8 +++++++-
 debian/tests/control       |  3 +++
 debian/tests/run-unit-test | 10 ++++++++++
 4 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/debian/examples b/debian/examples
new file mode 100644
index 0000000..dfe7769
--- /dev/null
+++ b/debian/examples
@@ -0,0 +1,2 @@
+test
+data
diff --git a/debian/rules b/debian/rules
index 029ca76..b9fd5fa 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,7 +7,7 @@
 #DEBVERS        := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
 #VERSION        := $(shell echo '$(DEBVERS)' | sed -e 's/^[0-9]*://' -e 's/-.*//')
 #DEBFLAVOR      := $(shell dpkg-parsechangelog | awk '/^Distribution:/ {print $$2}')
-#DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
+DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
 #DEBIAN_BRANCH  := $(shell awk 'BEGIN{FS="[= ]+"} /debian-branch/ {print $$2}' debian/gbp.conf)
 #GIT_TAG        := $(subst ~,_,$(VERSION))
 
@@ -19,5 +19,11 @@
 %:
 	dh $@ --with autoreconf
 
+override_dh_installexamples:
+	dh_installexamples
+	sed -i -e '/^TOPPREDDATA/d' \
+	    -e 's?../src/toppred?/usr/bin/toppred?' \
+	    debian/$(DEBPKGNAME)/usr/share/doc/$(DEBPKGNAME)/examples/test/*.test
+
 #get-orig-source:
 #	. debian/get-orig-source
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..199fb5e
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @, @builddeps@
+Restrictions: allow-stderr
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
new file mode 100644
index 0000000..7473be8
--- /dev/null
+++ b/debian/tests/run-unit-test
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+
+pkg=toppred
+if [ "$ADTTMP" = "" ] ; then
+  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+fi
+cd $ADTTMP
+
+cp -r /usr/lib/python2.7/dist-packages/screed/* .
+nosetests .

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



More information about the debian-med-commit mailing list