#!/bin/bash
set -e

pkg=nthash

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

cp -a /usr/share/doc/libnthash-dev/examples/* "${AUTOPKGTEST_TMP}"
cd "${AUTOPKGTEST_TMP}"
gunzip -r *

echo "Test library -- Functionality"
g++ -fopenmp -o sampletest kmer_hashing.cpp -lnthash -lbtllib
./sampletest > test1
cat test1
[ -s test1 ] || exit 1
echo "PASS"
