#!/bin/bash
set -e

CUR_DIR=`pwd`

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 ${CUR_DIR}/"test"/data/input/* $AUTOPKGTEST_TMP

cd $AUTOPKGTEST_TMP
gunzip -r *

echo "Test 1"
bio-vcf < somaticsniper.vcf 1> test1
[ -s test1 ] || exit 1
fgrep -q "TUMOR" test1
rm -f ./test1
echo "================================="
echo "PASS"

echo "Test 2"
bio-vcf --rdf --skip-header --eval '[r.alt,r.info.dp,r.tumor.gq.to_s]' < multisample.vcf  > test2
fgrep -q prefix test2 
rm -f ./test2
echo "=================================="
echo "PASS"


