Skip to content

Commit

Permalink
updated tests, added extensive
Browse files Browse the repository at this point in the history
  • Loading branch information
Bonson Wong committed Nov 24, 2023
1 parent 67afafe commit 5a04ab1
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions test/extensive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

URL="https://gtgseq.s3.amazonaws.com/ont-r10-dna/NA24385/raw/PGXX22394_reads.blow5"
READ_LIST="test/data/raw/PGXX22394_reads_chr22_readid.list"
OUT="test/data/out/"
BLOW_OUT="${OUT}reads.blow5"
EXP="363428f5351918ebcaf6f0f4a95e755c"
THREADS="512"

die() {
echo "$1" >&2
echo
exit 1
}

if [ "$1" = 'mem' ]; then
mem=1
else
mem=0
fi

ex() {
if [ $mem -eq 1 ]; then
valgrind --leak-check=full --error-exitcode=1 "$@"
else
"$@"
fi
}

echo_test_name() {
printf '\n--%s--\n' "$1"
}

# clean out dir
test -d ${OUT} && rm -r ${OUT}
mkdir ${OUT} || die "mkdir failed"

# large tests
TESTCASE_NAME="chr22_diff"
echo_test_name ${TESTCASE_NAME}
rm ${OUT}*
ex ./slow5curl get ${URL} -o ${BLOW_OUT} -l ${READ_LIST} -t ${THREADS} || die "Running the tool failed for test: ${TESTCASE_NAME}"
[[ $(md5sum ${BLOW_OUT} | cut -d' ' -f1 ) == ${EXP} ]] || die "diff failed for test: ${TESTCASE_NAME}"
1 change: 1 addition & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ echo_test_name() {
printf '\n--%s--\n' "$1"
}

# clean out dir
test -d ${OUT} && rm -r ${OUT}
mkdir ${OUT} || die "mkdir failed"

Expand Down

0 comments on commit 5a04ab1

Please sign in to comment.