#!/bin/sh -e

set -x
pkg=r-cran-testthat
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 \{\} \;
# Delete tests depending from devtools since this is not (yet) packaged
if grep -qR devtools * ; then
    rm -f `grep -lR devtools *`
fi

LC_ALL=C R --no-save < testthat.R
# rm -fr $ADTTMP/*
