#!/bin/sh -e

pkgname=plm
debname=r-cran-plm

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
gunzip -r *

# find . -name test_transformations_collapse.R -delete # this test checks whether collapse is available or not
if apt-cache show r-cran-collapse > /dev/null 2>/dev/null ; then
  echo "Package r-cran-collapse is available now - you should remove the quilt patch now."
  exit -1
fi

for testfile in *.R; do
    echo "BEGIN TEST $testfile"
    LC_ALL=C R --no-save < $testfile
done

