diff -Nru andi-0.12/debian/changelog andi-0.12/debian/changelog --- andi-0.12/debian/changelog 2017-08-09 08:25:35.000000000 +0000 +++ andi-0.12/debian/changelog 2018-03-07 11:12:24.000000000 +0000 @@ -1,3 +1,20 @@ +andi (0.12-3) unstable; urgency=medium + + * Allow for parallelisation of unit tests. Really fixes build failures. + + -- Fabian Klötzl Wed, 07 Mar 2018 12:12:24 +0100 + +andi (0.12-2) unstable; urgency=medium + + [ Fabian Klötzl ] + * Derandomize unit tests. Fixes build failures. + + [ Andreas Tille ] + * Standards-Version: 4.1.3 + * debhelper 11 + + -- Fabian Klötzl Mon, 05 Mar 2018 15:11:27 +0100 + andi (0.12-1) unstable; urgency=medium * Team upload. diff -Nru andi-0.12/debian/compat andi-0.12/debian/compat --- andi-0.12/debian/compat 2017-08-09 08:25:35.000000000 +0000 +++ andi-0.12/debian/compat 2018-03-07 11:12:24.000000000 +0000 @@ -1 +1 @@ -10 +11 diff -Nru andi-0.12/debian/control andi-0.12/debian/control --- andi-0.12/debian/control 2017-08-09 08:25:35.000000000 +0000 +++ andi-0.12/debian/control 2018-03-07 11:12:24.000000000 +0000 @@ -3,12 +3,12 @@ Uploaders: Fabian Klötzl Section: science Priority: optional -Build-Depends: debhelper (>= 10), +Build-Depends: debhelper (>= 11~), libdivsufsort-dev, pkgconf, libgsl-dev, libglib2.0-dev -Standards-Version: 4.0.0 +Standards-Version: 4.1.3 Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/andi.git Vcs-Git: https://anonscm.debian.org/git/debian-med/andi.git Homepage: https://github.com/EvolBioInf/andi diff -Nru andi-0.12/debian/patches/0001-Make-unit-tests-reproducible.patch andi-0.12/debian/patches/0001-Make-unit-tests-reproducible.patch --- andi-0.12/debian/patches/0001-Make-unit-tests-reproducible.patch 1970-01-01 00:00:00.000000000 +0000 +++ andi-0.12/debian/patches/0001-Make-unit-tests-reproducible.patch 2018-03-07 11:12:24.000000000 +0000 @@ -0,0 +1,162 @@ +From: Fabian Klötzl +Date: Mon, 5 Mar 2018 14:43:06 +0100 +Subject: Make unit tests reproducible +Applied-Upstream: https://github.com/EvolBioInf/andi/commit/394c3b4c3dfb8fd40530fd6815f300a273a309d2 + +--- + test/low_homo.sh | 15 ++++++++++++--- + test/nan.sh | 12 ++++++++++-- + test/test_extra.sh | 15 ++++++++++++--- + test/test_join.sh | 40 ++++++++++++++++++++++++++++++++-------- + 4 files changed, 66 insertions(+), 16 deletions(-) + +diff --git a/test/low_homo.sh b/test/low_homo.sh +index 72d1693..11e889e 100755 +--- a/test/low_homo.sh ++++ b/test/low_homo.sh +@@ -1,8 +1,17 @@ + #!/bin/bash -f + +-./test/test_fasta -l 100000 > a.fa +-./test/test_fasta -l 100000 > b.fa +-./test/test_fasta -l 100 > both.fa ++SEED=${RANDOM_SEED:-0} ++SEED2=0 ++SEED3=0 ++if test $SEED -ne 0; then ++ SEED=$((SEED + 1)) ++ SEED2=$((SEED + 2)) ++ SEED3=$((SEED + 3)) ++fi ++ ++./test/test_fasta -s $SEED -l 100000 > a.fa ++./test/test_fasta -s $SEED2 -l 100000 > b.fa ++./test/test_fasta -s $SEED3 -l 100 > both.fa + + cat both.fa a.fa | awk -vRS='>' '{if($1 == "S0")print ">"$0 > "S0.fa"}' + cat both.fa b.fa | awk -vRS='>' '{if($1 == "S1")print ">"$0 > "S1.fa"}' +diff --git a/test/nan.sh b/test/nan.sh +index e0502d0..60db0e2 100755 +--- a/test/nan.sh ++++ b/test/nan.sh +@@ -1,7 +1,15 @@ + #!/bin/bash -f + +-./test/test_fasta -l 10000 > a.fa +-./test/test_fasta -l 10000 > b.fa ++SEED=${RANDOM_SEED:-0} ++SEED2=0 ++if test $SEED -ne 0; then ++ SEED=$((SEED + 1)) ++ SEED2=$((SEED + 2)) ++fi ++ ++ ++./test/test_fasta -s $SEED -l 10000 > a.fa ++./test/test_fasta -s $SEED2 -l 10000 > b.fa + + # this is expected to trigger the nan warning + ./src/andi -j a.fa b.fa 2>&1 | grep 'nan' +diff --git a/test/test_extra.sh b/test/test_extra.sh +index dbb23ea..c1c0641 100755 +--- a/test/test_extra.sh ++++ b/test/test_extra.sh +@@ -3,17 +3,26 @@ + # Test if andi exists, and can be executed + ./src/andi --version > /dev/null || exit 1 + ++SEED=${RANDOM_SEED:-0} ++SEED2=0 ++SEED3=0 ++if test $SEED -ne 0; then ++ SEED=$((SEED + 1)) ++ SEED2=$((SEED + 2)) ++ SEED3=$((SEED + 3)) ++fi ++ + # Test andi for more than just two sequences at a time +-./test/test_fasta -l 100000 -d 0.01 -d 0.01 -d 0.01 -d 0.01 | ./src/andi > /dev/null || exit 1 ++./test/test_fasta -s $SEED -l 100000 -d 0.01 -d 0.01 -d 0.01 -d 0.01 | ./src/andi > /dev/null || exit 1 + + # Test low-memory mode +-./test/test_fasta -l 10000 > test_extra.fasta ++./test/test_fasta -s $SEED2 -l 10000 > test_extra.fasta + ./src/andi test_extra.fasta > extra.out + ./src/andi test_extra.fasta --low-memory > extra_low_memory.out + diff extra.out extra_low_memory.out || exit 1 + + # Test file of filenames +-./test/test_fasta -l 10000 > test_extra.fasta ++./test/test_fasta -s $SEED3 -l 10000 > test_extra.fasta + echo "$PWD/test_extra.fasta" > fof.txt + ./src/andi test_extra.fasta > extra.out + ./src/andi --file-of-filenames fof.txt > fof.out +diff --git a/test/test_join.sh b/test/test_join.sh +index 60e099a..33cc2c6 100755 +--- a/test/test_join.sh ++++ b/test/test_join.sh +@@ -2,10 +2,19 @@ + + ./src/andi --help > /dev/null || exit 1 + ++SEED=${RANDOM_SEED:-0} ++SEED2=0 ++SEED3=0 ++if test $SEED -ne 0; then ++ SEED=$((SEED + 1)) ++ SEED2=$((SEED + 2)) ++ SEED3=$((SEED + 3)) ++fi ++ + # Simple join test +-./test/test_fasta -l 1000 -L 1000 -d 0.1 > p1.fasta +-./test/test_fasta -l 1000 -L 1000 -d 0.1 > p2.fasta +-./test/test_fasta -l 10000 -L 10000 -d 0.1 > p3.fasta ++./test/test_fasta -s $SEED -l 1000 -L 1000 -d 0.1 > p1.fasta ++./test/test_fasta -s $SEED2 -l 1000 -L 1000 -d 0.1 > p2.fasta ++./test/test_fasta -s $SEED3 -l 10000 -L 10000 -d 0.1 > p3.fasta + + head -qn 2 p1.fasta p2.fasta p3.fasta > S0.fasta + tail -qn 2 p1.fasta p2.fasta p3.fasta > S1.fasta +@@ -25,9 +34,16 @@ if test $RES -ne 1; then + exit 1; + fi + ++SEED=${RANDOM_SEED:-0} ++SEED2=0 ++if test $SEED -ne 0; then ++ SEED=$((SEED + 5)) ++ SEED2=$((SEED + 6)) ++fi ++ + #unbalanced number of contigs +-./test/test_fasta -l 1000 -L 1000 -d 0.1 > p2.fasta +-./test/test_fasta -l 10000 -L 10000 -d 0.1 > p3.fasta ++./test/test_fasta -s $SEED -l 1000 -L 1000 -d 0.1 > p2.fasta ++./test/test_fasta -s $SEED2 -l 10000 -L 10000 -d 0.1 > p3.fasta + + head -qn 2 p3.fasta > S0.fasta + tail -qn 2 p2.fasta p3.fasta > S1.fasta +@@ -47,11 +63,19 @@ if test $RES -ne 1; then + exit 1; + fi + ++SEED=${RANDOM_SEED:-0} ++SEED2=0 ++SEED3=0 ++if test $SEED -ne 0; then ++ SEED=$((SEED + 11)) ++ SEED2=$((SEED + 12)) ++ SEED3=$((SEED + 13)) ++fi + + #unbalanced number of contigs 2 +-./test/test_fasta -l 1000 -L 1000 -d 0.1 > p1.fasta +-./test/test_fasta -l 1000 -L 1000 -d 0.1 > p2.fasta +-./test/test_fasta -l 10000 -L 10000 -d 0.1 > p3.fasta ++./test/test_fasta -s $SEED -l 1000 -L 1000 -d 0.1 > p1.fasta ++./test/test_fasta -s $SEED2 -l 1000 -L 1000 -d 0.1 > p2.fasta ++./test/test_fasta -s $SEED3 -l 10000 -L 10000 -d 0.1 > p3.fasta + + head -qn 2 p1.fasta p3.fasta > S0.fasta + tail -qn 2 p1.fasta p2.fasta p3.fasta > S1.fasta diff -Nru andi-0.12/debian/patches/0002-prefix-files-in-unit-tests.patch andi-0.12/debian/patches/0002-prefix-files-in-unit-tests.patch --- andi-0.12/debian/patches/0002-prefix-files-in-unit-tests.patch 1970-01-01 00:00:00.000000000 +0000 +++ andi-0.12/debian/patches/0002-prefix-files-in-unit-tests.patch 2018-03-07 11:12:24.000000000 +0000 @@ -0,0 +1,182 @@ +From: =?utf-8?q?Fabian_Kl=C3=B6tzl?= +Date: Wed, 7 Mar 2018 11:26:26 +0100 +Subject: prefix files in unit tests +Applied-Upstream: https://github.com/EvolBioInf/andi/commit/e35d1a51f71541f246919a277386817f69c94a3e + +Unit tests can be run in parallel (see debian builds). Thus they should +work on different files, otherwise bad and confusing things happen. +--- + test/low_homo.sh | 16 ++++++++-------- + test/nan.sh | 10 +++++----- + test/test_join.sh | 48 ++++++++++++++++++++++++------------------------ + 3 files changed, 37 insertions(+), 37 deletions(-) + +diff --git a/test/low_homo.sh b/test/low_homo.sh +index 11e889e..1f16a79 100755 +--- a/test/low_homo.sh ++++ b/test/low_homo.sh +@@ -9,21 +9,21 @@ if test $SEED -ne 0; then + SEED3=$((SEED + 3)) + fi + +-./test/test_fasta -s $SEED -l 100000 > a.fa +-./test/test_fasta -s $SEED2 -l 100000 > b.fa +-./test/test_fasta -s $SEED3 -l 100 > both.fa ++./test/test_fasta -s $SEED -l 100000 > a_low.fa ++./test/test_fasta -s $SEED2 -l 100000 > b_low.fa ++./test/test_fasta -s $SEED3 -l 100 > both_low.fa + +-cat both.fa a.fa | awk -vRS='>' '{if($1 == "S0")print ">"$0 > "S0.fa"}' +-cat both.fa b.fa | awk -vRS='>' '{if($1 == "S1")print ">"$0 > "S1.fa"}' ++cat both_low.fa a_low.fa | awk -vRS='>' '{if($1 == "S0")print ">"$0 > "S0_low.fa"}' ++cat both_low.fa b_low.fa | awk -vRS='>' '{if($1 == "S1")print ">"$0 > "S1_low.fa"}' + + # this is expected to trigger the low homology warning +-./src/andi -j S0.fa S1.fa 2>&1 | grep 'homology' ++./src/andi -j S0_low.fa S1_low.fa 2>&1 | grep 'homology' + EXIT_VAL=$? + + if [[ EXIT_VAL -ge 1 ]]; then + echo "Triggering low homology failed" >&2 +- grep '^>' a.fa b.fa both.fa ++ grep '^>' a_low.fa b_low.fa both_low.fa + fi + +-rm -f a.fa b.fa both.fa S0.fa S1.fa ++rm -f a_low.fa b_low.fa both_low.fa S0_low.fa S1_low.fa + exit $EXIT_VAL +diff --git a/test/nan.sh b/test/nan.sh +index 60db0e2..97fa167 100755 +--- a/test/nan.sh ++++ b/test/nan.sh +@@ -8,18 +8,18 @@ if test $SEED -ne 0; then + fi + + +-./test/test_fasta -s $SEED -l 10000 > a.fa +-./test/test_fasta -s $SEED2 -l 10000 > b.fa ++./test/test_fasta -s $SEED -l 10000 > a_nan.fa ++./test/test_fasta -s $SEED2 -l 10000 > b_nan.fa + + # this is expected to trigger the nan warning +-./src/andi -j a.fa b.fa 2>&1 | grep 'nan' ++./src/andi -j a_nan.fa b_nan.fa 2>&1 | grep 'nan' + EXIT_VAL=$? + + + if [[ EXIT_VAL -ge 1 ]]; then + echo "Triggering nan failed" >&2 +- grep '^>' a.fa b.fa both.fa ++ grep '^>' a_nan.fa b_nan.fa + fi + +-rm -f a.fa b.fa ++rm -f a_nan.fa b_nan.fa + exit $EXIT_VAL +diff --git a/test/test_join.sh b/test/test_join.sh +index 33cc2c6..a0616bf 100755 +--- a/test/test_join.sh ++++ b/test/test_join.sh +@@ -12,17 +12,17 @@ if test $SEED -ne 0; then + fi + + # Simple join test +-./test/test_fasta -s $SEED -l 1000 -L 1000 -d 0.1 > p1.fasta +-./test/test_fasta -s $SEED2 -l 1000 -L 1000 -d 0.1 > p2.fasta +-./test/test_fasta -s $SEED3 -l 10000 -L 10000 -d 0.1 > p3.fasta ++./test/test_fasta -s $SEED -l 1000 -L 1000 -d 0.1 > p1_join.fasta ++./test/test_fasta -s $SEED2 -l 1000 -L 1000 -d 0.1 > p2_join.fasta ++./test/test_fasta -s $SEED3 -l 10000 -L 10000 -d 0.1 > p3_join.fasta + +-head -qn 2 p1.fasta p2.fasta p3.fasta > S0.fasta +-tail -qn 2 p1.fasta p2.fasta p3.fasta > S1.fasta ++head -qn 2 p1_join.fasta p2_join.fasta p3_join.fasta > S0_join.fasta ++tail -qn 2 p1_join.fasta p2_join.fasta p3_join.fasta > S1_join.fasta + +-rm p1.fasta p2.fasta p3.fasta; ++rm p1_join.fasta p2_join.fasta p3_join.fasta; + + +-RES=$(./src/andi -m RAW -t 1 -j S0.fasta S1.fasta | ++RES=$(./src/andi -m RAW -t 1 -j S0_join.fasta S1_join.fasta | + tail -n 1 | + awk '{print ($2 - 0.1)}' | + awk 'function abs(x){return ((x < 0.0) ? -x : x)} {print abs($1-$2) < 0.03}' +@@ -30,7 +30,7 @@ RES=$(./src/andi -m RAW -t 1 -j S0.fasta S1.fasta | + + if test $RES -ne 1; then + echo "The last test computed a distance deviating more than three percent from its intended value." +- echo "See S0.fasta and S1.fasta for the used sequences." ++ echo "See S0_join.fasta and S1_join.fasta for the used sequences." + exit 1; + fi + +@@ -42,16 +42,16 @@ if test $SEED -ne 0; then + fi + + #unbalanced number of contigs +-./test/test_fasta -s $SEED -l 1000 -L 1000 -d 0.1 > p2.fasta +-./test/test_fasta -s $SEED2 -l 10000 -L 10000 -d 0.1 > p3.fasta ++./test/test_fasta -s $SEED -l 1000 -L 1000 -d 0.1 > p2_join.fasta ++./test/test_fasta -s $SEED2 -l 10000 -L 10000 -d 0.1 > p3_join.fasta + +-head -qn 2 p3.fasta > S0.fasta +-tail -qn 2 p2.fasta p3.fasta > S1.fasta ++head -qn 2 p3_join.fasta > S0_join.fasta ++tail -qn 2 p2_join.fasta p3_join.fasta > S1_join.fasta + +-rm p2.fasta p3.fasta; ++rm p2_join.fasta p3_join.fasta; + + +-RES=$(./src/andi -m RAW -t1 -j S0.fasta S1.fasta | ++RES=$(./src/andi -m RAW -t1 -j S0_join.fasta S1_join.fasta | + tail -n 1 | + awk '{print ($2 - 0.1)}' | + awk 'function abs(x){return ((x < 0.0) ? -x : x)} {print abs($1-$2) < 0.03}' +@@ -59,7 +59,7 @@ RES=$(./src/andi -m RAW -t1 -j S0.fasta S1.fasta | + + if test $RES -ne 1; then + echo "The last test computed a distance deviating more than three percent from its intended value." +- echo "See S0.fasta and S1.fasta for the used sequences." ++ echo "See S0_join.fasta and S1_join.fasta for the used sequences." + exit 1; + fi + +@@ -73,17 +73,17 @@ if test $SEED -ne 0; then + fi + + #unbalanced number of contigs 2 +-./test/test_fasta -s $SEED -l 1000 -L 1000 -d 0.1 > p1.fasta +-./test/test_fasta -s $SEED2 -l 1000 -L 1000 -d 0.1 > p2.fasta +-./test/test_fasta -s $SEED3 -l 10000 -L 10000 -d 0.1 > p3.fasta ++./test/test_fasta -s $SEED -l 1000 -L 1000 -d 0.1 > p1_join.fasta ++./test/test_fasta -s $SEED2 -l 1000 -L 1000 -d 0.1 > p2_join.fasta ++./test/test_fasta -s $SEED3 -l 10000 -L 10000 -d 0.1 > p3_join.fasta + +-head -qn 2 p1.fasta p3.fasta > S0.fasta +-tail -qn 2 p1.fasta p2.fasta p3.fasta > S1.fasta ++head -qn 2 p1_join.fasta p3_join.fasta > S0_join.fasta ++tail -qn 2 p1_join.fasta p2_join.fasta p3_join.fasta > S1_join.fasta + +-rm p1.fasta p2.fasta p3.fasta; ++rm p1_join.fasta p2_join.fasta p3_join.fasta; + + +-RES=$(./src/andi -mRAW -t 1 -j S0.fasta S1.fasta | ++RES=$(./src/andi -mRAW -t 1 -j S0_join.fasta S1_join.fasta | + tail -n 1 | + awk '{print ($2 - 0.1)}' | + awk 'function abs(x){return ((x < 0.0) ? -x : x)} {print abs($1-$2) < 0.03}' +@@ -91,9 +91,9 @@ RES=$(./src/andi -mRAW -t 1 -j S0.fasta S1.fasta | + + if test $RES -ne 1; then + echo "The last test computed a distance deviating more than three percent from its intended value." +- echo "See S0.fasta and S1.fasta for the used sequences." ++ echo "See S0_join.fasta and S1_join.fasta for the used sequences." + exit 1; + fi + + +-rm S0.fasta S1.fasta ++rm S0_join.fasta S1_join.fasta diff -Nru andi-0.12/debian/patches/series andi-0.12/debian/patches/series --- andi-0.12/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ andi-0.12/debian/patches/series 2018-03-07 11:12:24.000000000 +0000 @@ -0,0 +1,2 @@ +0001-Make-unit-tests-reproducible.patch +0002-prefix-files-in-unit-tests.patch