[med-svn] [Git][med-team/trf][master] 3 commits: tmp
Nilesh Patra
gitlab at salsa.debian.org
Thu Jul 16 12:07:40 BST 2020
Nilesh Patra pushed to branch master at Debian Med / trf
Commits:
b982e084 by Nilesh Patra at 2020-07-16T10:38:06+00:00
tmp
- - - - -
9433f83a by Nilesh Patra at 2020-07-16T11:06:05+00:00
Fix exit codes
- - - - -
b6c5733e by Nilesh Patra at 2020-07-16T11:06:27+00:00
Try to diff against results for test check
- - - - -
4 changed files:
- + debian/patches/fix-exit-code.patch
- + debian/patches/series
- debian/tests/control
- debian/tests/run-unit-test
Changes:
=====================================
debian/patches/fix-exit-code.patch
=====================================
@@ -0,0 +1,23 @@
+Author: Nilesh Patra <npatra974 at gmail.com>
+Description: Fix exit return codes on successful completion.
+Last-Changed: Thu July 16, 2020
+--- a/src/trfrun.h
++++ b/src/trfrun.h
+@@ -304,7 +304,7 @@
+
+ paramset.endstatus = CTRL_SUCCESS;
+ paramset.running = 0;
+- return 1;
++ return 0;
+ }
+ paramset.multisequencefile = 1;
+ paramset.sequenceordinal = 1;
+@@ -590,7 +590,7 @@
+
+ paramset.endstatus = CTRL_SUCCESS;
+ paramset.running = 0;
+- return i;
++ return 0;
+ }
+
+ /*************************************************
=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+fix-exit-code.patch
=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
Tests: run-unit-test
-Depends: @
+Depends: @, html2text, bc
Restrictions: allow-stderr
=====================================
debian/tests/run-unit-test
=====================================
@@ -15,3 +15,44 @@ cd "${AUTOPKGTEST_TMP}"
gunzip *.gz
trf test_seqs.fasta 2 5 7 80 10 50 2000 -l 10
+
+echo "comparing test results ..."
+html2text test_seqs.fasta.s1.2.5.7.80.10.50.2000.1.html > test.txt
+result=`cat test.txt | grep -A 2 Entropy | grep -Ev 'Entropy|Size'`
+result=${result//_}
+echo "$result"
+
+function check_compare()
+{
+ # $1: result of the command
+ # $2: value to compare result with
+ if (( $(echo "$1 < $2" |bc -l) ))
+ then
+ exit 1
+ fi
+}
+
+IFS='|'
+read -ra ADDR <<< "$result"
+cnt=0
+for i in "${ADDR[@]}";
+do
+ echo $i
+
+ if [ "$cnt" = 2 ]
+ then
+ echo "Compare consensus size"
+ if [ "$i" != 7 ]
+ then
+ exit 1
+ fi
+ fi
+
+ if [ "$cnt" = 12 ]
+ then
+ echo "Comparing extropy"
+ check_compare $i 1.5
+ fi
+ ((cnt++))
+done
+
View it on GitLab: https://salsa.debian.org/med-team/trf/-/compare/b6c7bb87829c2a984ba75f1f47e4e09cd1125832...b6c5733e3dc19ca64bf7982253266fe291fa2ba2
--
View it on GitLab: https://salsa.debian.org/med-team/trf/-/compare/b6c7bb87829c2a984ba75f1f47e4e09cd1125832...b6c5733e3dc19ca64bf7982253266fe291fa2ba2
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/20200716/f71a3c1b/attachment-0001.html>
More information about the debian-med-commit
mailing list