#!/bin/sh -e

oname=R.methodsS3
pkg=r-cran-`echo $oname | tr '[A-Z]' '[a-z]'`

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 \{\} \;
for rfile in *.[rR] ; do
  R CMD BATCH $rfile
done
rm -fr $ADTTMP/*
