[med-svn] [Git][med-team/bppsuite][master] Improve autopkgtests
Pranav Ballaney
gitlab at salsa.debian.org
Fri Jun 12 05:25:53 BST 2020
Pranav Ballaney pushed to branch master at Debian Med / bppsuite
Commits:
06f67230 by Pranav Ballaney at 2020-06-12T09:55:45+05:30
Improve autopkgtests
- - - - -
1 changed file:
- debian/tests/run-unit-test
Changes:
=====================================
debian/tests/run-unit-test
=====================================
@@ -4,7 +4,7 @@ set -e
pkg=bppsuite
export LC_ALL=C.UTF-8
-if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+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.
@@ -18,224 +18,59 @@ cd "${AUTOPKGTEST_TMP}"
gunzip -r *
-echo -e "\e[93m\e[1mTest 1\e[0m"
-cd MaximumLikelihood/Codons/BranchModel
-bppml param=ML.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
+run_test() {
+ # $1: test number
+ # $2: command
+ # $3: path to file
+ # $4: filename
+ # $5: outfile
+ # $6: reference
+ echo -e "\e[93m\e[1mTest $1\e[0m"
+ cd $3
+ $2 param=$4
+ if [ "$?" -ne "0" ]; then
+ echo -e "\e[31m\e[1mTest $1 could not be run.\e[0m"
exit 1
-fi
-diff lysozymeLarge.ML.dnd ../../../ref/branch-lysozymeLarge.ML.dnd --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"
-cd ../CladeModel
-bppml param=ML.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
+ fi
+ diff $5 $6 --suppress-common-lines
+ if [ "$?" -ne "0" ]; then
+ echo -e "\e[31m\e[1mOutput did not match the reference.\e[0m"
exit 1
-fi
-diff lysozymeLarge.ML.dnd ../../../ref/clade-lysozymeLarge.ML.dnd --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"
+ fi
+ echo -e "\e[92m\e[1mPassed\e[0m"
+}
-echo -e "\e[93m\e[1mTest 3\e[0m"
-cd ../M0
-bppml param=ML.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff lysozymeLarge.ML.dnd ../../../ref/m0-lysozymeLarge.ML.dnd --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"
+run_test 1 bppml MaximumLikelihood/Codons/BranchModel ML.bpp lysozymeLarge.ML.dnd ../../../ref/branch-lysozymeLarge.ML.dnd
-echo -e "\e[93m\e[1mTest 4\e[0m"
-cd ../../Nucleotides/Homogeneous
-bppml param=ML.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff LSU.ML.dnd ../../../ref/LSU.ML.dnd --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"
+run_test 2 bppml ../CladeModel ML.bpp lysozymeLarge.ML.dnd ../../../ref/clade-lysozymeLarge.ML.dnd
-echo -e "\e[93m\e[1mTest 5\e[0m"
-cd ../../Proteins/Homogeneous
-bppml param=ML.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff Myo.ML.dnd ../../../ref/Myo.ML.dnd --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"
+run_test 3 bppml ../M0 ML.bpp lysozymeLarge.ML.dnd ../../../ref/m0-lysozymeLarge.ML.dnd
-echo -e "\e[93m\e[1mTest 6\e[0m"
-cd ../../../SequenceSimulation/Homogeneous
-bppseqgen param=SeqGen.bpp --seed=5
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff LSUSim.fasta ../../ref/Homogeneous-LSUSim.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"
+run_test 4 bppml ../../Nucleotides/Homogeneous ML.bpp LSU.ML.dnd ../../../ref/LSU.ML.dnd
-echo -e "\e[93m\e[1mTest 7\e[0m"
-cd ../../SequenceSimulation/HomogeneousCovarion
-bppseqgen param=SeqGen.bpp --seed=5
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff LSUSim.fasta ../../ref/HomogeneousCovarion-LSUSim.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"
+run_test 5 bppml ../../Proteins/Homogeneous ML.bpp Myo.ML.dnd ../../../ref/Myo.ML.dnd
-echo -e "\e[93m\e[1mTest 8\e[0m"
-cd ../../SequenceSimulation/NonHomogeneous
-bppseqgen param=SeqGen.bpp --seed=5
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff LSUSim.fasta ../../ref/NonHomogeneous-LSUSim.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"
+run_test 6 bppseqgen ../../../SequenceSimulation/Homogeneous "SeqGen.bpp --seed=5" LSUSim.fasta ../../ref/Homogeneous-LSUSim.fasta
-echo -e "\e[93m\e[1mTest 9\e[0m"
-cd ../../SequenceSimulation/WithSiteSpecificSettings
-bppseqgen param=SeqGen.bpp --seed=5
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff LSUSim.fasta ../../ref/WithSiteSpecificSettings-LSUSim.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"
+run_test 7 bppseqgen ../HomogeneousCovarion "SeqGen.bpp --seed=5" LSUSim.fasta ../../ref/HomogeneousCovarion-LSUSim.fasta
-echo -e "\e[93m\e[1mTest 10\e[0m"
-cd ../../Distance
-bppdist param=Dist.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff LSU.mat ../ref/dist-LSU.mat --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"
+run_test 8 bppseqgen ../NonHomogeneous "SeqGen.bpp --seed=5" LSUSim.fasta ../../ref/NonHomogeneous-LSUSim.fasta
-echo -e "\e[93m\e[1mTest 11\e[0m"
-cd ../Parsimony
-bpppars param=Pars.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
+run_test 9 bppseqgen ../WithSiteSpecificSettings "SeqGen.bpp --seed=5" LSUSim.fasta ../../ref/WithSiteSpecificSettings-LSUSim.fasta
+
+run_test 10 bppdist ../../Distance Dist.bpp LSU.mat ../ref/dist-LSU.mat
+
+run_test 11 bpppars ../Parsimony Pars.bpp Pars.bpp Pars.bpp
# No comparison since output appears to be different everytime
# and no seed parameter can be provided
-echo -e "\e[92m\e[1mPassed\e[0m"
-
-echo -e "\e[93m\e[1mTest 12\e[0m"
-cd ../ReRooting
-bppreroot param=ReRoot.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff treeList2_rooted.dnd ../ref/treeList2_rooted.dnd --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"
+# comparing imput file against itself to obey function rules
-echo -e "\e[93m\e[1mTest 13\e[0m"
-cd ../SequenceManipulation
-bppseqman param=SeqMan.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff LSU.fas ../ref/seqman-LSU.fas --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"
+run_test 12 bppreroot ../ReRooting ReRoot.bpp treeList2_rooted.dnd ../ref/treeList2_rooted.dnd
-echo -e "\e[93m\e[1mTest 14\e[0m"
-cd ../AlignmentScoring
-bppalnscore param=AlnScores.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff HIV1_REF_2010_gag.scores.txt ../ref/HIV1_REF_2010_gag.scores.txt --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"
+run_test 13 bppseqman ../SequenceManipulation SeqMan.bpp LSU.fas ../ref/seqman-LSU.fas
-echo -e "\e[93m\e[1mTest 15\e[0m"
-cd ../PopStats
-bpppopstats param=PopStatsCodonSites.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff alignment.codons.csv ../ref/popstats-alignment.codons.csv --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"
+run_test 14 bppalnscore ../AlignmentScoring AlnScores.bpp HIV1_REF_2010_gag.scores.txt ../ref/HIV1_REF_2010_gag.scores.txt
-echo -e "\e[93m\e[1mTest 16\e[0m"
-cd ../Drawing
-bpptreedraw param=TreeDraw.bpp
-if [ "$?" -ne "0" ]; then
- echo -e "\e[31m\e[1mTest could not be run.\e[0m"
- exit 1
-fi
-diff LSU.svg ../ref/treedraw-LSU.svg --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"
+run_test 15 bpppopstats ../PopStats PopStatsCodonSites.bpp alignment.codons.csv ../ref/popstats-alignment.codons.csv
+run_test 16 bpptreedraw ../Drawing TreeDraw.bpp LSU.svg ../ref/treedraw-LSU.svg
View it on GitLab: https://salsa.debian.org/med-team/bppsuite/-/commit/06f67230abd4a3d953fc4f561fb3e97c8d1961d5
--
View it on GitLab: https://salsa.debian.org/med-team/bppsuite/-/commit/06f67230abd4a3d953fc4f561fb3e97c8d1961d5
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200612/0e95cd7c/attachment-0001.html>
More information about the debian-med-commit
mailing list