summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiubov Chuprikova <chuprikovalv@gmail.com>2018-04-08 23:15:17 +0000
committerLiubov Chuprikova <chuprikovalv@gmail.com>2018-04-08 23:15:17 +0000
commit6576aed1e8963efbf350b53b881fa5f6413887d3 (patch)
tree647f9c3f205b8d5df36c4218476da248e481775f
parent079812d944e1439a630f523eea18141f1ddc5584 (diff)
Autopkgtest: improved a couple of tests by checking its output content
-rw-r--r--debian/tests/run-unit-test60
1 files changed, 43 insertions, 17 deletions
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
index ffaec8c3..e16056c9 100644
--- a/debian/tests/run-unit-test
+++ b/debian/tests/run-unit-test
@@ -14,44 +14,70 @@ cp /usr/share/ncbi/data/autofix.prt .
cp /usr/share/ncbi/data/UniVec.* .
gunzip *.gz
-echo '---asn2all test---'
-/usr/bin/asn2all -i nc0225.aso -b -f g -o nc0225.nuc -v nc0225.prt
-[ -s nc0225.nuc ]
-[ -s nc0225.prt ]
-
+##################################################################
echo '---asn2asn test---'
+##################################################################
/usr/bin/asn2asn -i nc0225.aso -b -o nc0225.text
+/usr/bin/asn2asn -i nc0225.text -s -o nc0225_new.aso
[ -s nc0225.text ]
+[ -s nc0225_new.aso ]
+diff nc0225.aso nc0225_new.aso
+rm nc0225.aso nc0225_new.aso
+##################################################################
+echo '---asn2all test---'
+##################################################################
+/usr/bin/asn2all -i nc0225.text -f g -o nc0225.nuc -v nc0225.prt
+[ -s nc0225.nuc ]
+genes_dna="$(grep -c " mol dna ," nc0225.text)"
+genes_rna="$(grep -c " mol rna ," nc0225.text)"
+genes=$(expr $genes_dna + $genes_rna)
+nuc="$(grep -c "^LOCUS " nc0225.nuc)"
+[ $genes -eq $nuc ]
+[ -s nc0225.prt ]
+proteins="$(grep -c " mol aa ," nc0225.text)"
+prt="$(grep -c "^LOCUS " nc0225.prt)"
+[ $proteins -eq $prt ]
+
+##################################################################
echo '---asn2fsa test---'
-/usr/bin/asn2fsa -i nc0225.aso -b -a t -o nc0225.fna -v nc0225.faa
+##################################################################
+/usr/bin/asn2fsa -i nc0225.text -a t -o nc0225.fna -v nc0225.faa
[ -s nc0225.fna ]
+fna="$(grep -c "^>" nc0225.fna)"
+[ $genes -eq $fna ]
[ -s nc0225.faa ]
+faa="$(grep -c "^>" nc0225.faa)"
+[ $proteins -eq $faa ]
+##################################################################
echo '---asn2gb test---'
-/usr/bin/asn2gb -i nc0225.aso -b -a t -o nc0225.gbk
+##################################################################
+/usr/bin/asn2gb -i nc0225.text -a t -o nc0225.gbk
[ -s nc0225.gbk ]
+gbk="$(grep -c "^LOCUS " nc0225.gbk)"
+[ $genes -eq $gbk ]
+
echo '---asn2idx test---'
-/usr/bin/asn2idx -b -p . < nc0225.aso
+/usr/bin/asn2idx -p . -x .text < nc0225.text
[ -s nc0225.idx ]
[ -s master.idx ]
echo '---asn2xml test---'
-/usr/bin/asn2xml -i nc0225.aso -o nc0225.xml
+/usr/bin/asn2xml -i nc0225.text -b F -o nc0225.xml
[ -s nc0225.xml ]
echo '---asndisc test---'
-/usr/bin/asndisc -i nc0225.aso -b -a t -o nc0225.disc
+/usr/bin/asndisc -i nc0225.text -a t -o nc0225.disc
[ -s nc0225.disc ]
echo '---asnval test---'
-/usr/bin/asnval -i nc0225.aso -b -a t -o nc0225.val
-[ -f nc0225.val ]
-[ ! -s nc0225.val ] # empty
+/usr/bin/asnval -i nc0225.text -a t -o nc0225.val -Q 2
+[ -s nc0225.val ]
echo '---asnmacro test---'
-/usr/bin/asnmacro -i nc0225.aso -b -m autofix.prt -o asnmacro.output
+/usr/bin/asnmacro -i nc0225.text -m autofix.prt -o asnmacro.output
[ -s asnmacro.output ]
echo '---asntool test---'
@@ -59,8 +85,8 @@ echo '---asntool test---'
[ -s asntool.output ]
echo '---cleanasn test---'
-/usr/bin/cleanasn -b -a t -D t -i nc0225.aso -o nc0225_cleaned.aso
-[ -s nc0225_cleaned.aso ]
+/usr/bin/cleanasn -a t -D t -i nc0225.text -o nc0225_cleaned.text
+[ -s nc0225_cleaned.text ]
echo '---debruijn test---'
/usr/bin/debruijn -a ncbistdaa -n 4 > debruijn.output
@@ -70,9 +96,9 @@ echo '---gene2xml test---'
/usr/bin/gene2xml -b -i dsRNA_viruses.ags -o dsRNA_viruses.xgs
[ -s dsRNA_viruses.xgs ]
-grep 'GI:' nc0225.gbk | head | sed 's/.*GI://' > GIs.txt
# _insdseqget_ and _idfetch_ testing requires internet connection.
# Comment the lines below to skip the testing.
+grep 'GI:' nc0225.gbk | head | sed 's/.*GI://' > GIs.txt
echo '---insdseqget test---'
/usr/bin/insdseqget -n -i GIs.txt > insdset.xml
[ -s insdset.xml ]