| 1 | #!/bin/bash |
| 2 | set -e |
| 3 | |
| 4 | pkg="fastqc" |
| 5 | test_failures=0 |
| 6 | |
| 7 | if [ "$AUTOPKGTEST_TMP" = "" ] ; then |
| 8 | AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX` |
| 9 | trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM |
| 10 | fi |
| 11 | |
| 12 | cp -a /usr/share/doc/${pkg}/examples/* $AUTOPKGTEST_TMP |
| 13 | |
| 14 | cd $AUTOPKGTEST_TMP |
| 15 | |
| 16 | find . -name "*.gz" -exec gunzip \{\} \; |
| 17 | |
| 18 | for sample in example.fastq toy_sam.sam toy_bam.bam ; do |
| 19 | /usr/bin/fastqc --extract "$sample" |
| 20 | result="${sample%%.*}_fastqc" |
| 21 | expected="${result}_expected_summary.txt" |
| 22 | if ! diff -q "${result}/summary.txt" ${expected} 2>/dev/null ; then |
| 23 | (( test_failures += 1 )) |
| 24 | cat <<EOT |
| 25 | Summary results did not match contents of ${expected} for |
| 26 | fastqc "$sample" |
| 27 | Please investigate! |
| 28 | EOT |
| 29 | else |
| 30 | echo "Summary results match for: fastqc "$sample" " |
| 31 | fi |
| 32 | rm -rf "$result"* |
| 33 | echo "" |
| 34 | done |
| 35 | |
| 36 | if (( test_failures == 0 )); then |
| 37 | echo "PASS" |
| 38 | exit 0 |
| 39 | fi |
| 40 | |
| 41 | echo "FAIL mismatched fastqc summary count: $test_failures" |
| 42 | exit 1 |