Skip to content

Commit a333a29

Browse files
committed
Make tests scripts less verbose
1 parent bd183f5 commit a333a29

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

tests/compare-baseline.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if ! test -f ${baseline_bam}; then
5252
git clone . ${srcdir}
5353
( cd ${srcdir} && git checkout -d ${baseline_commit} )
5454
cmake ${srcdir} -B ${srcdir}/build ${cmake_options}
55-
if ! make -j 4 -C ${srcdir}/build strobealign; then
55+
if ! make -s -j 4 -C ${srcdir}/build strobealign; then
5656
exit 1
5757
fi
5858
mv ${srcdir}/build/strobealign ${baseline_binary}
@@ -65,7 +65,7 @@ fi
6565
# compiler options.
6666
builddir=$(mktemp -p . -d build.XXXXXXX)
6767
cmake . -B ${builddir} ${cmake_options}
68-
make -j 4 -C ${builddir} strobealign
68+
make -s -j 4 -C ${builddir} strobealign
6969
set -x
7070
${builddir}/strobealign ${strobealign_options} ${ref} ${reads[@]} | samtools view -o head.bam
7171
rm -rf ${builddir}

tests/run.sh

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -xeuo pipefail
2+
set -euo pipefail
33

44
if [[ $OSTYPE = linux-gnu ]]; then
55
color="--color=always"
@@ -8,15 +8,18 @@ else
88
fi
99

1010
function strobealign() {
11-
build/strobealign "${@}"
11+
echo "Testing '${@}'" >&2
12+
build/strobealign "${@}" 2> testlog.txt
1213
}
1314

1415
function diff() {
15-
env diff -u ${color} "$1" "$2"
16+
if ! env diff -u ${color} "$1" "$2"; then
17+
echo "Failure running 'diff $1 $2'"
18+
exit 1
19+
fi
1620
}
1721

18-
# Unit tests
19-
build/test-strobealign
22+
build/test-strobealign --no-intro
2023

2124
# should fail when unknown command-line option used
2225
if strobealign -G > /dev/null 2> /dev/null; then false; fi
@@ -106,3 +109,5 @@ rm no-secondary.sam with-secondary.sam with-secondary-only-primary.sam repeated-
106109
strobealign -C --no-PG --rg-id=1 --rg=SM:sample --rg=LB:library tests/phix.fasta tests/phix.tags.fastq > with-tags.sam
107110
diff tests/phix.tags.sam with-tags.sam
108111
rm with-tags.sam
112+
113+
echo "Success"

0 commit comments

Comments
 (0)