[r-cran-misctools] 12/13: Modify autopkgtest run-unit-test to not check output against .Rout files.

Sébastien Villemot sebastien at debian.org
Mon Oct 2 13:51:31 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-misctools.

commit f9b67c382c1ada2854672c15fab4623077dd6da9
Author: Sébastien Villemot <sebastien at debian.org>
Date:   Mon Oct 2 15:49:54 2017 +0200

    Modify autopkgtest run-unit-test to not check output against .Rout files.
    
    This always fails due to numerical precision errors.
    
    Gbp-Dch: Full
---
 debian/tests/run-unit-test | 43 +++++++++----------------------------------
 1 file changed, 9 insertions(+), 34 deletions(-)

diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
index c3e6c15..b36b6a8 100644
--- a/debian/tests/run-unit-test
+++ b/debian/tests/run-unit-test
@@ -1,42 +1,17 @@
 #!/bin/sh -e
 
-pkg=r-cran-misctools
-
-# 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:' \
-        -e '^ISBN 3-900051-07-0' \
-        -e '^\[1\] "L*C' \
-        -e '^During startup - Warning messages:' \
-        -e '^[0-9]: Setting LC_' \
-        -e "'help.start()' for an* HTML browser interface to help." \
-       $1 | \
-    sed '/^> *proc\.time()$/,$d'
-}
+pkgname=miscTools
+debname=r-cran-misctools
 
 if [ "$ADTTMP" = "" ] ; then
-  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+    ADTTMP=`mktemp -d /tmp/${debname}-test.XXXXXX`
+    trap "rm -rf $ADTTMP" 0 INT QUIT ABRT PIPE TERM
 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 --ignore-space-change ${htest}.Rout.save_ ${htest}.Rout_
-   if [ ! $? ] ; then
-     echo "Test ${htest} failed"
-     exit 1
-   else
-     echo "Test ${htest} passed"
-   fi
+cp -a /usr/share/doc/$debname/tests/* $ADTTMP
+gunzip -r *
+for testfile in *.R; do
+    echo "BEGIN TEST $testfile"
+    LC_ALL=C R --no-save < $testfile
 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-misctools.git



More information about the debian-science-commits mailing list