#!/bin/bash
set -e

pkg=nanopolish

export LC_ALL=C.UTF-8
if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

cd ${AUTOPKGTEST_TMP}

# The ./test/data path is hard-coded into the nanopolish_test program
mkdir test

cp -r /usr/share/doc/${pkg}/examples/data ${AUTOPKGTEST_TMP}/test

find ${AUTOPKGTEST_TMP}/test -name '*.gz' | xargs -r gunzip

/usr/lib/nanopolish/nanopolish_test
