#!/bin/sh -e
# http://dep.debian.net/deps/dep8/
# Autopkgtest: Test if plink1.9 run analysis correctly
# Author: Dylan Aïssi <daissi@debian.org>

pkg=plink1.9
if [ "$AUTOPKGTEST_TMP" = "" ] ; then
  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
fi
cd $AUTOPKGTEST_TMP
cp -a /usr/share/doc/${pkg}/examples/* $AUTOPKGTEST_TMP

PLINK19_TEST='plink1.9 --file toy'

# Allele frequencies
$PLINK19_TEST --freq
diff plink.frq expected.plink.frq

# Case/control or QTL association
$PLINK19_TEST --assoc
diff plink.assoc expected.plink.assoc

rm -f $AUTOPKGTEST_TMP/*

