#!/bin/sh -e

oname=curl
debname=r-cran-`echo $oname | tr [A-Z] [a-z]`

if [ "$AUTOPKGTEST_TMP" = "" ] ; then
  AUTOPKGTEST_TMP=`mktemp -d /tmp/${debname}-test.XXXXXX`
  trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
fi
cd $AUTOPKGTEST_TMP
cp -a /usr/share/doc/${debname}/tests/* $AUTOPKGTEST_TMP

# Authentication needs internet access which is permitted for autokpgtest
find . -name test-auth.R -delete

LC_ALL=C.UTF-8 R --no-save < testthat.R
