#!/bin/sh -e

pkg=r-cran-future
if [ "$AUTOPKGTEST_TMP" = "" ] ; then
  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
fi
cd $AUTOPKGTEST_TMP
cp -a /usr/share/doc/${pkg}/tests/* $AUTOPKGTEST_TMP
find . -name "*.gz" -exec gunzip \{\} \;
export LC_ALL=C
for test in *R
do
  R CMD BATCH ${test}
  echo "Test ${test} passed"
done
rm -rf $AUTOPKGTEST_TMP/*
