[r-cran-spam] 02/05: Fix autopkgtest:

Sébastien Villemot sebastien at debian.org
Sun Nov 19 14:53:55 UTC 2017


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

sebastien pushed a commit to branch master
in repository r-cran-spam.

commit 906b49a33a4067aaa2da142957ee9f4ba6e0f908
Author: Sébastien Villemot <sebastien at debian.org>
Date:   Sun Nov 19 15:23:19 2017 +0100

    Fix autopkgtest:
    
    + add missing r-cran-{testthat,fields} test dependencies
    + skip demo_jss15-Leroux.R test, needs truncdist which is not in Debian
    + update d/tests/run-unit-test so that it displays test results
    
    Gbp-Dch: Full
---
 debian/tests/control       |  2 +-
 debian/tests/run-unit-test | 32 +++++++++++++++-----------------
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/debian/tests/control b/debian/tests/control
index d2aa55a..a838fda 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,3 @@
 Tests: run-unit-test
-Depends: @
+Depends: @, r-cran-testthat, r-cran-fields
 Restrictions: allow-stderr
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
index 5899a77..f1deac3 100644
--- a/debian/tests/run-unit-test
+++ b/debian/tests/run-unit-test
@@ -1,24 +1,22 @@
 #!/bin/sh -e
 
-oname=spam
-pkg=r-cran-`echo $oname | tr [A-Z] [a-z]`
+pkgname=spam
+debname=r-cran-spam
 
-if [ "$ADTTMP" = "" ] ; then
-  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+if [ "$AUTOPKGTEST_TMP" = "" ] ; then
+    AUTOPKGTEST_TMP=`mktemp -d /tmp/${debname}-test.XXXXXX`
+    trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
 fi
-cd $ADTTMP
-cp -a /usr/share/doc/${pkg}/tests/* $ADTTMP
-# gunzip *.gz
+cd $AUTOPKGTEST_TMP
+cp -a /usr/share/doc/${debname}/tests/* $AUTOPKGTEST_TMP
+gunzip -r *
 export LC_ALL=C
-for test in *R
+for testfile 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
+    # Skip demo_jss15-Leroux.R, which needs truncdist which is not
+    # in Debian (as of 2017-11-28)
+    [ "$testfile" = "demo_jss15-Leroux.R" ] && continue
+
+    echo "BEGIN TEST $testfile"
+    LC_ALL=C R --no-save < $testfile
 done
-rm -f $ADTTMP/*

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



More information about the debian-science-commits mailing list