#!/bin/sh -e

pkg=r-cran-genetics
if [ "$AUTOPKGTEST_TMP" = "" ] ; then
  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
fi
cd $AUTOPKGTEST_TMP
cp -a /usr/share/doc/${pkg}/tests/* $AUTOPKGTEST_TMP
#gunzip *.gz
export LC_ALL=C
for test in *R
do
  R CMD BATCH ${test}
  if [ ! $? ] ; then
    echo "Test ${test} failed"
    exit 1
  else
    echo "Test ${test} passed"
  fi
  rm -f ${test}out .RData
done
rm -f $AUTOPKGTEST_TMP/*
