[med-svn] [r-cran-crayon] 03/09: Add unit tests

Andreas Tille tille at debian.org
Mon Oct 9 09:50:53 UTC 2017


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

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

commit b1209e23e555904673be914b80c49b371dbc379d
Author: Andreas Tille <tille at debian.org>
Date:   Wed Jul 8 17:39:32 2015 +0000

    Add unit tests
---
 debian/README.test         |  8 ++++++++
 debian/docs                |  3 +++
 debian/tests/control       |  3 +++
 debian/tests/run-unit-test | 13 +++++++++++++
 4 files changed, 27 insertions(+)

diff --git a/debian/README.test b/debian/README.test
new file mode 100644
index 0000000..53fb4d7
--- /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/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..b044b0c
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @, r-cran-testthat
+Restrictions: allow-stderr
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
new file mode 100644
index 0000000..f3d1af1
--- /dev/null
+++ b/debian/tests/run-unit-test
@@ -0,0 +1,13 @@
+#!/bin/sh -e
+
+pkg=r-cran-crayon
+
+if [ "$ADTTMP" = "" ] ; then
+  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+fi
+cd $ADTTMP
+cp -a /usr/share/doc/${pkg}/tests/* $ADTTMP
+find . -name "*.gz" -exec gunzip \{\} \;
+# Make sure we are using C locale to pass all tests
+LC_ALL=C R --no-save < testthat.R
+rm -rf $ADTTMP/*

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



More information about the debian-med-commit mailing list