[med-svn] [pftools] 02/02: Add autopkgtest

Andreas Tille tille at debian.org
Wed Mar 22 15:48:53 UTC 2017


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

tille pushed a commit to branch master
in repository pftools.

commit 63b88386602800591265166db2f73321877468f5
Author: Andreas Tille <tille at debian.org>
Date:   Wed Mar 22 16:48:38 2017 +0100

    Add autopkgtest
---
 debian/README.test         |  8 ++++++++
 debian/docs                |  2 ++
 debian/rules               |  2 ++
 debian/tests/control       |  3 +++
 debian/tests/run-unit-test | 20 ++++++++++++++++++++
 5 files changed, 35 insertions(+)

diff --git a/debian/README.test b/debian/README.test
new file mode 100644
index 0000000..ef34ccc
--- /dev/null
+++ b/debian/README.test
@@ -0,0 +1,8 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+To run the unit tests provided by the package you can do
+
+   sh run-unit-test
+
+in this directory.
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/rules b/debian/rules
index a81a3a0..b0d0071 100755
--- a/debian/rules
+++ b/debian/rules
@@ -38,6 +38,7 @@ override_dh_installexamples:
 	    -e 's:^/bin/rm sh3.fsp:/bin/rm -f sh3.fsp:' \
 	    -e "1a ln -sf /usr/lib/$(DEBPKGNAME)/[CGM]* ." \
 	    -e "1a ln -sf /usr/lib/$(DEBPKGNAME)/*.cmp ." \
+	    -e "1a ln -sf /usr/lib/$(DEBPKGNAME)/*.lis ." \
 	    -e "1a ln -sf /usr/lib/$(DEBPKGNAME)/*.prf ." \
 	    -e "1a ln -sf /usr/lib/$(DEBPKGNAME)/*.seq ." \
 	    -e "1a ln -sf /usr/lib/$(DEBPKGNAME)/*sh3.* ." \
@@ -50,3 +51,4 @@ override_dh_auto_test:
 	        -e '/^DT  */d' > test.build
 	grep -v '^DT  *' test.out > test.compare
 	diff -u test.compare test.build
+	
\ No newline at end of file
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..d2aa55a
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @
+Restrictions: allow-stderr
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
new file mode 100644
index 0000000..3017b15
--- /dev/null
+++ b/debian/tests/run-unit-test
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -e
+
+pkg="pftools"
+
+if [ "$ADTTMP" = "" ] ; then
+  ADTTMP=$(mktemp -d /tmp/${pkg}-${testbin}-test.XXXXXX)
+  # trap "rm -rf $ADTTMP" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cd $ADTTMP
+
+cp -a /usr/share/doc/${pkg}/examples/* .
+
+. ./test.sh | \
+    sed -e '/^MA/s/\(N_SCORE=[68].5\)0*/\1/' \
+        -e '/^DT  */d' \
+        -e 's:CC   /GENERATED_BY="/usr/bin/pfmake:CC   /GENERATED_BY="./pfmake:' > test.runtime
+zcat test.out | grep -v '^DT  *'  > test.compare
+diff -u test.compare test.runtime

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



More information about the debian-med-commit mailing list