[r-cran-formatr] 09/12: Add autopkgtest

Andreas Tille tille at debian.org
Tue Nov 29 12:45:54 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-formatr.

commit 424038e4204e9d99d1b705265fee4cf92d68b945
Author: Andreas Tille <tille at debian.org>
Date:   Tue Nov 29 13:30:22 2016 +0100

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

diff --git a/debian/README.test b/debian/README.test
new file mode 100644
index 0000000..4fe93f7
--- /dev/null
+++ b/debian/README.test
@@ -0,0 +1,9 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by running the provided test:
+
+cd tests
+LC_ALL=C R --no-save < test-all.R
+
+in order to confirm its integrity.
diff --git a/debian/changelog b/debian/changelog
index e2e4fca..7a1a9d9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ r-cran-formatr (1.4-1) UNRELEASED; urgency=medium
   * d/watch:
      - version=4
      - do not replace '-' by '.' in upstream version
+  * Add autopkgtest
 
  -- Andreas Tille <tille at debian.org>  Tue, 29 Nov 2016 13:10:23 +0100
 
diff --git a/debian/docs b/debian/docs
index b43bf86..68bebb2 100644
--- a/debian/docs
+++ b/debian/docs
@@ -1 +1,4 @@
 README.md
+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..552c2e2
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @, r-cran-testit
+Restrictions: allow-stderr
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
new file mode 100644
index 0000000..f41d715
--- /dev/null
+++ b/debian/tests/run-unit-test
@@ -0,0 +1,13 @@
+#!/bin/sh -e
+
+oname=formatR
+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 \{\} \;
+LC_ALL=C R --no-save < test-all.R

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



More information about the debian-science-commits mailing list