1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#!/bin/sh
#use test.tar.xz from /usr/share/doc/subread/examples/ if executed with
#autopkgtest
#use binaries and test dir from the source package if executed
#by override_dh_auto_test:
set -e
pkg=subread
examplesdir=/usr/share/doc/$pkg/examples
if [ $# -eq 0 ]
then
TMPDIR=$(mktemp -d)
trap "rm -rf $TMPDIR" 0 INT QUIT ABRT PIPE TERM
tar -xf ${examplesdir}/test.tar.xz -C $TMPDIR
WORKDIR=${TMPDIR}/test
#copy binaries to the location expected by the tests
mkdir ${TMPDIR}/bin
for bin in exactSNP featureCounts subjunc subindel subread-align subread-buildindex
do
cp /usr/bin/${bin} ${TMPDIR}/bin/
done
else
#run tests in the source package if executed during building process
TMPDIR=$1
cp -r ${TMPDIR}/test ${TMPDIR}/adt_test
export PATH=${PATH}:${TMPDIR}/bin:${TMPDIR}:/bin/utilities
WORKDIR=${TMPDIR}/adt_test
fi
cd $WORKDIR
bash test_all.sh
if [ $# -eq 0 ]
then
rm -rf $TMPDIR
else
rm -rf $WORKDIR
fi
|