1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#!/bin/bash
set -e
pkg=pullseq
CUR_DIR=`pwd`
export LC_ALL=C.UTF-8
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/* "${AUTOPKGTEST_TMP}"
cd "${AUTOPKGTEST_TMP}"
function compare_cksum()
{
# $1: file whose md5sum needs to be tested
# $2: expected checksum
if [ "$(cat $1 | md5sum | awk '{print $1}')" != "$2" ]
then
echo "Checksums do not match"
exit 1
fi
}
echo "Test 1"
pullseq -i test.fa -n test.txt > test1
compare_cksum test1 2b63bfcc3ecddd47bfa1e7d6d53af06e
rm -f test1
echo "PASS"
echo "Test2"
pullseq -i utest_c.fa -t > test2
compare_cksum test2 8f128cd4ad4fbcdb9ac7cb31269f25c3
rm -f test2
echo "PASS"
echo "Test 3"
pullseq -i test.fa -m 80 -a 90 > test3
compare_cksum test3 d41d8cd98f00b204e9800998ecf8427e
rm -f test3
echo "PASS"
echo "Test 4"
seqdiff -1 utest_b.fa -2 utest_c.fa 2>/dev/null 1>test4
compare_cksum test4 ab9be31a9d9f83f1fd1261b51b753999
rm -f test4
echo "PASS"
|