#!/bin/sh -e

pkg="genometester"

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
cp -a /usr/share/doc/${pkg}/test-data/* .
gunzip *.gz

echo '---glistmaker test---'
/usr/bin/glistmaker Ccr.fa -o Ccr
/usr/bin/glistmaker Mg.fa -o Mg

echo '---glistquery test---'
/usr/bin/glistquery Ccr_16.list > Ccr_16.query
/usr/bin/glistquery Mg_16.list > Mg_16.query
[ -s Ccr_16.query ]
[ -s Mg_16.query ]

echo '---glistcompare test---'
/usr/bin/glistcompare Ccr_16.list Mg_16.list --union -o Ccr_Mg
/usr/bin/glistcompare Ccr_16.list Mg_16.list --intersection -o Ccr_Mg
/usr/bin/glistcompare Ccr_16.list Mg_16.list --difference -o Ccr_Mg
[ -s Ccr_Mg_16_0_diff1.list ]
[ -s Ccr_Mg_16_intrsec.list ]
[ -s Ccr_Mg_16_union.list ]
