Debian Codegraph @

debian/tests/run-unit-test

raw symbols SCIP
1 #!/bin/bash
2 set -ex
3
4 pkg=canu
5
6 export LC_ALL=C.UTF-8
7 if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
8 AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
9 # shellcheck disable=SC2064
10 trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
11 fi
12 export TMPDIR="${AUTOPKGTEST_TMP}"
13
14 #if [ "${AUTOPKGTEST_ARTIFACTS}" = "" ] ; then
15 # AUTOPKGTEST_ARTIFACTS=${PWD}
16 #fi
17 #cd "${AUTOPKGTEST_ARTIFACTS}"
18 # Too big, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050388
19 cd "${AUTOPKGTEST_TMP}"
20
21 cores=$(nproc)
22 mem=$(free --giga | grep Mem | awk '{ print $7}')
23 if ((mem < 6)) ; then
24 echo "At least 6G of memory is required to run this test."
25 exit 77
26 elif ((mem < 8)) ; then
27 oeaMemory=oeaMemory=${mem}g
28 redMemory=redMemory=${mem}g
29 else
30 oeaMemory=
31 redMemory=
32 fi
33 if ((cores < 4)) ; then
34 corThreads=corThreads=${cores}
35 else
36 corThreads=
37 fi
38
39 curl -L -o "${AUTOPKGTEST_TMP}"/pacbio.fastq \
40 http://gembox.cbcb.umd.edu/mhap/raw/ecoli_p6_25x.filtered.fastq
41 set +e
42 # shellcheck disable=SC2086
43 canu -p ecoli -d ecoli-pacbio \
44 genomeSize=4.8m \
45 maxThreads="${cores}" ${corThreads} ${oeaMemory} ${redMemory} \
46 -pacbio "${AUTOPKGTEST_TMP}"/pacbio.fastq ; result=$?
47
48 if [ ! "${AUTOPKGTEST_ARTIFACTS}" = "" ] ; then
49 cp ecoli-pacbio/*.report ecoli-pacbio/*.err "${AUTOPKGTEST_ARTIFACTS}/"
50 cp $(find ecoli-pacbio -name "*\.out") "${AUTOPKGTEST_ARTIFACTS}/"
51 cp -r ecoli-pacbio/canu-logs "${AUTOPKGTEST_ARTIFACTS}/"
52 fi
53
54 exit ${result}