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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#!/bin/bash
set -e
pkg=mapsembler2
export LC_ALL=C.UTF-8
if [ "${AUTOPKGTEST_TMP}" = "" ]; then
AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
# Double quote below to expand the temporary directory variable now versus
# later is on purpose.
# shellcheck disable=SC2064
trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi
cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
cd "${AUTOPKGTEST_TMP}"
gunzip -r *
#do_stuff_to_test_package#
echo -e "\e[93m\e[1mTest 1\e[0m"
run_mapsembler2_pipeline -s starter.fa -r "reads1.fa reads2.fa" -t 3 -p res
if [ "$?" -ne "0" ]; then
echo -e "\e[31m\e[1mTest could not be run.\e[0m"
exit 1
fi
diff res_k_31_c_5_t_3_modified_and_covered.json ref-res_k_31_c_5_t_3_modified_and_covered.json --suppress-common-lines
if [ "$?" -ne "0" ]; then
echo -e "\e[31m\e[1mOutput did not match the reference.\e[0m"
exit 1
fi
echo -e "\e[92m\e[1mPassed\e[0m"
echo -e "\e[93m\e[1mTest 2\e[0m"
run_mapsembler2_pipeline -s starter.fa -r "reads1.fa reads2.fa" -t 1 -p reads1
if [ "$?" -ne "0" ]; then
echo -e "\e[31m\e[1mTest could not be run.\e[0m"
exit 1
fi
diff reads1_coherent_k_31_c_5_t_1.fasta ref-reads1_coherent_k_31_c_5_t_1.fasta --suppress-common-lines
diff reads1_uncoherent_k_31_c_5_t_1.fasta ref-reads1_uncoherent_k_31_c_5_t_1.fasta --suppress-common-lines
if [ "$?" -ne "0" ]; then
echo -e "\e[31m\e[1mOutput did not match the reference.\e[0m"
exit 1
fi
echo -e "\e[92m\e[1mPassed\e[0m"
echo -e "\e[93m\e[1mTest 3\e[0m"
mapsembler_extend starter.fa reads1.fa reads2.fa
if [ "$?" -ne "0" ]; then
echo -e "\e[31m\e[1mTest could not be run.\e[0m"
exit 1
fi
diff res_mapsembler_k_31_c_2_t_1.fasta ref-res_mapsembler_k_31_c_2_t_1.fasta --suppress-common-lines
if [ "$?" -ne "0" ]; then
echo -e "\e[31m\e[1mOutput did not match the reference.\e[0m"
exit 1
fi
echo -e "\e[92m\e[1mPassed\e[0m"
echo -e "\e[93m\e[1mTest 4\e[0m"
mapsembler2_extremities --k 20 --starters reads1_coherent_k_31_c_5_t_1.fasta --reads "reads1.fa reads2.fa" --output mapsembler2_extremities.out.fa
if [ "$?" -ne "0" ]; then
echo -e "\e[31m\e[1mTest could not be run.\e[0m"
exit 1
fi
diff mapsembler2_extremities.out.fa ref-mapsembler2_extremities.out.fa --suppress-common-lines
if [ "$?" -ne "0" ]; then
echo -e "\e[31m\e[1mOutput did not match the reference.\e[0m"
exit 1
fi
echo -e "\e[92m\e[1mPassed\e[0m"
|