#!/bin/sh -e

oname=affy
pkg=r-bioc-`echo $oname | tr [A-Z] [a-z]`
if [ "$ADTTMP" = "" ] ; then
  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
fi
cd $ADTTMP
cp -a /usr/lib/R/site-library/${oname}/tests/* $ADTTMP
find . -name "*.gz" -exec gunzip \{\} \;
for runtest in `ls *.R` ; do
    if ! grep -wq affydata $runtest ; then
	R --no-save < $runtest
    else
	echo "Since affydata is not (yet) packaged we can not run test $runtest"
    fi
done
rm -f $ADTTMP/*
