/usr/share/doc/r-cran-etm/run-unit-test is in r-cran-etm 0.6-2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #!/bin/sh -e
pkg=r-cran-etm
# 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 '^Platform: ' \
-e '^ISBN 3' \
-e '^Loading required package: lattice' \
-e '^Loading required package: splines' \
$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
find . -name "*.gz" -exec gunzip \{\} \;
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
|