File: run-unit-test

package info (click to toggle)
mosdepth 0.3.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,956 kB
  • sloc: sh: 244; python: 132; makefile: 28
file content (41 lines) | stat: -rw-r--r-- 878 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -e

pkg=mosdepth

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.
  # shellcheck disable=SC2064
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

cp -a /usr/share/doc/${pkg}-examples/* "${AUTOPKGTEST_TMP}"

cd "${AUTOPKGTEST_TMP}"
gunzip -r *.gz

echo "Test 1"
mosdepth --by empty-tids.bed --thresholds 1,10,20,30 test1 empty-tids.bam
for f in test1*
do
	[ -s $f ] || exit 1
done
cat test1.*.txt | tail -20
rm test1*
echo "PASS"

echo "Test 2"
mosdepth --by empty-tids.bed --quantize 0:1:4:100:200 test2 empty-tids.bam
for f in test2*
do
	[ -s $f ] || exit 1
done
cat test2.*.txt | tail -20
echo "PASS"

echo "Tet 3"
python3 plot-dist.py test2.mosdepth.global.dist.txt
[ -s dist.html ]
echo "PASS"