#!/bin/bash
set -e

pkg="fastqc"

if [ "$AUTOPKGTEST_TMP" = "" ] ; then
  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
fi

cp -a /usr/share/doc/${pkg}/examples/* $AUTOPKGTEST_TMP

cd $AUTOPKGTEST_TMP

gunzip *.gz

/usr/bin/fastqc example.fastq
unzip example_fastqc.zip
cat example_fastqc/summary.txt
rm -rf example_fastqc*

/usr/bin/fastqc toy.sam
unzip toy_fastqc.zip
cat toy_fastqc/summary.txt
rm -rf toy_fastqc*

/usr/bin/fastqc toy.bam
unzip toy_fastqc.zip
cat toy_fastqc/summary.txt
rm -rf toy_fastqc*

echo "PASS"
