Debian Codegraph @

debian/tests/run-unit-test

raw
1 #!/bin/bash
2 set -e
3
4 export LC_ALL=C.UTF-8
5 if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
6 AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
7 # Double quote below to expand the temporary directory variable now versus
8 # later is on purpose.
9 # shellcheck disable=SC2064
10 trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
11 fi
12
13
14 cp -a debian/tests/testdata.tar.xz "${AUTOPKGTEST_TMP}"
15 cd "${AUTOPKGTEST_TMP}"
16
17 tar -xf testdata.tar.xz
18
19 OUTPUT_FILE_1="test1"
20 OUTPUT_FILE_2="test2"
21
22 gunzip -c reads.fastq.gz | NanoFilt -q 8 -l 500 --headcrop 50 > "$OUTPUT_FILE_1"
23 # Double check and make sure file is actually generated and is non-zero size
24 if [ -s "$OUTPUT_FILE_1" ];
25 then
26 echo "[1] PASS"
27 else
28 echo "[1] FAIL"
29 exit 1
30 fi
31
32 gunzip -c reads.fastq.gz | NanoFilt -q 7 --maxGC 0.75 --headcrop 75 | gzip > trimmed-reads.fastq.gz
33 echo "[2] PASS"
34
35 gunzip -c reads.fastq.gz | NanoFilt -q 6 -s sequencing_summary.txt > "$OUTPUT_FILE_2"
36 if [ -s "$OUTPUT_FILE_2" ];
37 then
38 echo "[3] PASS"
39 else
40 echo "[3] FAIL"
41 fi