[r-cran-markdown] 01/01: Add autopkgtest

Andreas Tille tille at debian.org
Wed May 4 07:04:13 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-markdown.

commit 8a503d56d2fe07d4d49fe7f8a4bda3600e5727fc
Author: Andreas Tille <tille at debian.org>
Date:   Wed May 4 08:57:58 2016 +0200

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

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 4c5f009..9f27d7a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,4 +2,5 @@ r-cran-markdown (0.7.7-1) unstable; urgency=low
 
   * Initial release. Closes: #813481
 
- -- Joost van Baal-Ilić Tue, 03 May 2016 21:25:01 +0200
+ -- Joost van Baal-Ilić <joostvb at debian.org>  Tue, 03 May 2016 21:25:01 +0200
+
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..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..1e90976
--- /dev/null
+++ b/debian/tests/run-unit-test
@@ -0,0 +1,38 @@
+#!/bin/sh -e
+
+pkg=r-cran-markdown
+
+# 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 '^R : Copyright 20' \
+        -e '^Version 2.0' \
+        -e '^Platform:' \
+       $1 | \
+    sed -e '/^> *proc\.time()$/,$d' \
+        -e '/^  Natural language support but running in an English locale$/,+1d'
+}
+
+if [ "$ADTTMP" = "" ] ; then
+  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+fi
+cd $ADTTMP
+cp /usr/share/doc/${pkg}/tests/* $ADTTMP
+gunzip *.gz
+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
+rm -f $ADTTMP/*
+
+exit 0

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



More information about the debian-science-commits mailing list