#!/bin/sh -e

pkgname=vioplot
debname=r-cran-vioplot

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 *
for testfile in *.R; do
    echo "BEGIN TEST $testfile"
    LC_ALL=C.UTF-8 R --no-save < $testfile
    # Output claims that DISPLAY is not set and thus no tests are run.  When doing
    #   LC_ALL=C.UTF-8 /usr/bin/xvfb-run --auto-servernum --server-num=20 -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" R --no-save < $testfile
    # the output vanished - but all tests are skipped anyway
    # In case this might be re-activated do not forget to add xauth, xvfb to test depends.
done

