#!/bin/sh -e

cat <<EOT
These tests result in something like
   Listening on http://127.0.0.1:7613
and can not be used as autopkgtest in this form.
EOT
exit

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

if [ "$AUTOPKGTEST_TMP" = "" ] ; then
  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
  trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
fi
cd $AUTOPKGTEST_TMP
cp -a /usr/lib/R/site-library/${oname}/tests/* $AUTOPKGTEST_TMP
find . -name "*.gz" -exec gunzip \{\} \;
for rfile in *.[rR] ; do
  R CMD BATCH $rfile
  echo "$rfile passed"
done
