#!/bin/sh -e

if [ "$ADTTMP" = "" ] ; then
  ADTTMP=`mktemp -d /tmp/bedtools-test.XXXXXX`
  trap "rm -rf $ADTTMP" 0 INT QUIT ABRT PIPE TERM
fi

# Copy test suite there
cp -a /usr/share/bedtools/test $ADTTMP

# Link to genomes files
cd $ADTTMP

ln -s /usr/share/bedtools/genomes

# Enter the directory and run the tests
cd $ADTTMP/test
DATA=/usr/share/bedtools/data BT=/usr/bin/bedtools sh test.sh

