[r-cran-lsmeans] 04/04: Add autopkgtest

Andreas Tille tille at debian.org
Fri Nov 4 12:31:12 UTC 2016


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

tille pushed a commit to branch master
in repository r-cran-lsmeans.

commit 103d0cb3a878be086d1b1318ecc47a057720455f
Author: Andreas Tille <tille at debian.org>
Date:   Fri Nov 4 13:30:20 2016 +0100

    Add autopkgtest
---
 debian/README.test         |  8 ++++++++
 debian/changelog           |  5 +++--
 debian/docs                |  3 +++
 debian/tests/control       |  3 +++
 debian/tests/run-unit-test | 39 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/debian/README.test b/debian/README.test
new file mode 100644
index 0000000..55a9142
--- /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/changelog b/debian/changelog
index f1e852e..3717473 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,11 @@
-r-cran-lsmeans (2.24-1) UNRELEASED; urgency=medium
+r-cran-lsmeans (2.24-1) unstable; urgency=medium
 
   * Team upload
   * New upstream release
   * Convert to debhelper
+  * Add autopkgtest
 
- -- Andreas Tille <tille at debian.org>  Fri, 04 Nov 2016 13:06:28 +0100
+ -- Andreas Tille <tille at debian.org>  Fri, 04 Nov 2016 13:08:56 +0100
 
 r-cran-lsmeans (2.23-1) unstable; urgency=low
 
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..3adf0d6
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,3 @@
+debian/README.test
+debian/tests/run-unit-test
+tests
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..be42856
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @, dos2unix
+Restrictions: allow-stderr
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
new file mode 100644
index 0000000..d1ba6b5
--- /dev/null
+++ b/debian/tests/run-unit-test
@@ -0,0 +1,39 @@
+#!/bin/sh -e
+
+pkg=r-cran-lsmeans
+
+# The saved result files do contain some differences in metadata and we also
+# need to ignore version differences of R
+filter() {
+    grep -v -e '^R version' \
+        -e '^Copyright (C)' \
+        -e '^Platform:' \
+        -e '^ISBN 3-900051-07-0' \
+        -e '^\[1\] "L*C' \
+        -e '^During startup - Warning messages:' \
+        -e '^R Under development' \
+        -e '^[0-9]: Setting LC_' \
+       $1 | \
+    sed '/^> *proc\.time()$/,$d'
+}
+
+if [ "$ADTTMP" = "" ] ; then
+  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+  trap "rm -rf $ADTTMP" 0 INT QUIT ABRT PIPE TERM
+fi
+cd $ADTTMP
+cp /usr/share/doc/${pkg}/tests/* $ADTTMP
+find . -name "*.gz" -exec gunzip \{\} \;
+find . -name "*.Rout.save" -exec dos2unix --quiet \{\} \; 
+for htest in `ls *.R | sed 's/\.R$//'` ; do
+   LC_ALL=C R --no-save < ${htest}.R 2>&1 | tee > ${htest}.Rout
+   filter ${htest}.Rout.save > ${htest}.Rout.save_
+   filter ${htest}.Rout > ${htest}.Rout_
+   diff -u ${htest}.Rout.save_ ${htest}.Rout_
+   if [ ! $? ] ; then
+     echo "Test ${htest} failed"
+     exit 1
+   else
+     echo "Test ${htest} passed"
+   fi
+done

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-lsmeans.git



More information about the debian-science-commits mailing list