#!/bin/sh -e

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

if [ "$ADTTMP" = "" ] ; then
  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
  trap "rm -rf $ADTTMP" 0 INT QUIT ABRT PIPE TERM
fi
cd $ADTTMP
cp -a /usr/lib/R/site-library/${oname}/tests $ADTTMP
ls -R $ADTTMP
LC_ALL=C R --no-save <<EOR
    require("yaml")
    require("testthat")
    test_dir("tests")
EOR
