File: run-unit-test

package info (click to toggle)
bowtie2 2.5.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,556 kB
  • sloc: cpp: 64,301; perl: 7,232; sh: 1,131; python: 993; makefile: 606; ansic: 122
file content (58 lines) | stat: -rwxr-xr-x 1,561 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
set -e

pkg=bowtie2

export LC_ALL=C.UTF-8
if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

cp -ar /usr/share/doc/${pkg}/examples "${AUTOPKGTEST_TMP}"/
cp -ar scripts/test "${AUTOPKGTEST_TMP}"/
cp -ar scripts/sim "${AUTOPKGTEST_TMP}"/

cd "${AUTOPKGTEST_TMP}"/test
perl simple_tests.pl --bowtie2=/usr/bin/bowtie2 \
	--bowtie2-build=/usr/bin/bowtie2-build \
	--compressed

cd "${AUTOPKGTEST_TMP}"/sim
perl run.pl --bowtie2=/usr/bin/bowtie2 \
	--bowtie2-build=/usr/bin/bowtie2-build \
	--cpus=$(nproc)

cd "${AUTOPKGTEST_TMP}"/examples

# check-wo-arguments
TMP="$(mktemp)"
# Run bowtie2 without any arguments and save stderr in a temporary file:
set +e
STDOUT="$(bowtie2 2> ${TMP})"
# Exit status of the previous command should be 1
[ "$?" -eq 1 ]
set -e
# Save help message into a variable:
HELP_MESSAGE="$(bowtie2 --help)"
# Check if stderr contains help message:
grep -q "${HELP_MESSAGE}" "${TMP}"
echo "SUCCESS: help message was detected!"
rm "${TMP}"

# indexing-ref-genome
examplesdir=/usr/share/doc/$pkg/examples
for file in reference/lambda_virus.fa.gz reads/reads_1.fq.gz
do
	extracted=`echo $file | awk -F/ '{print $NF}'`
        zcat $examplesdir/$file >${extracted%.gz}
done
bowtie2-build lambda_virus.fa lambda_virus >/dev/null 2>&1
bowtie2 -x lambda_virus -U reads_1.fq -S eg1.sam >/dev/null 2>&1

# binary-run
for file in build align inspect
do
	${pkg}-${file}-l -h >/dev/null 2>&1
	${pkg}-${file}-s -h >/dev/null 2>&1
done