[r-cran-mime] 08/09: Add autopkgtest

Andreas Tille tille at debian.org
Mon Dec 5 16:46:19 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-mime.

commit 8cce76b0c8c8a81370feec8e5b63f0c3368caa02
Author: Andreas Tille <tille at debian.org>
Date:   Mon Dec 5 17:42:24 2016 +0100

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

diff --git a/debian/README.test b/debian/README.test
new file mode 100644
index 0000000..d409f9a
--- /dev/null
+++ b/debian/README.test
@@ -0,0 +1,8 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by running the provided test:
+
+     sh run-unit-test
+
+in order to confirm its integrity.
diff --git a/debian/changelog b/debian/changelog
index 4ce1dd0..33f3ab7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ r-cran-mime (0.5-1) UNRELEASED; urgency=medium
   * d/watch:
      - version=4
      - do not s/-/./
+  * Add autopkgtest
 
  -- Andreas Tille <tille at debian.org>  Mon, 05 Dec 2016 17:23:17 +0100
 
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..960011c
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,3 @@
+tests
+debian/README.test
+debian/tests/run-unit-test
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..e015f42
--- /dev/null
+++ b/debian/tests/run-unit-test
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+
+oname=mime
+pkg=r-cran-`echo $oname | tr '[A-Z]' '[a-z]'`
+
+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/* $ADTTMP
+find . -name "*.gz" -exec gunzip \{\} \;
+export LC_ALL=C
+for test in *R
+do
+  R CMD BATCH ${test}
+  if [ ! $? ] ; then
+    echo "Test ${test} failed"
+    exit 1
+  else
+    echo "Test ${test} passed"
+  fi
+  rm -f ${test}out .RData
+done

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



More information about the debian-science-commits mailing list