#!/bin/sh -e

pkg=r-cran-globals
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 \{\} \;
export LC_ALL=C
for test in *R
do
  R CMD BATCH ${test}
  echo "Test ${test} passed"
done
rm -f $ADTTMP/*
