File: dune-autopkgtest

package info (click to toggle)
dune-common 2.10.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 5,804 kB
  • sloc: cpp: 52,256; python: 3,979; sh: 1,658; makefile: 17
file content (62 lines) | stat: -rwxr-xr-x 1,316 bytes parent folder | download | duplicates (4)
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
59
60
61
62
#! /bin/bash

set -e
set -u

fail() {
    echo >&2 "${1:-E: Unknown error}"
    exit 1
}

if [ ! -v AUTOPKGTEST_TMP ]; then
  fail "E: dune-autopkgtest must be invoked by autopkgtest"
fi

sourcedir=${PWD}

dependencies=
mpi=

while [ $# -ge 1 ]; do
    case "${1}" in
        --depends)
            dependencies="${2}"
            shift 2
            ;;
        --mpi)
            mpi="${2}"
            shift 2
            ;;
        *)
            break
    esac
done

if [ $# -ne 1 ]; then
    fail "E: No source given"
fi
source=${1}

if [ -z "${dependencies}" ]; then
    dependencies=$(dpkg-parsechangelog --show-field Source)
fi

cd "${AUTOPKGTEST_TMP}"
duneproject "dune-autopkgtest" "${dependencies}" "0.0.1" "DUNE autopkgtest <invalid@invalid>" <<< y ||
    fail "E: Setting up dune-autopkgtest project failed"

cp "${sourcedir}/${source}" "${AUTOPKGTEST_TMP}/dune-autopkgtest/src/dune-autopkgtest.cc"

cd dune-autopkgtest

. ${DUNE_DEBIAN_ENV:-/usr/share/dune/dune-debian.env}

dunecontrol --current all ||
    fail "E: Building the package failed."

./build-cmake/src/dune-autopkgtest ||
    fail "E: Running the test program failed."
if [ -n "${mpi}" ]; then
    mpirun -np "${mpi}" ./build-cmake/src/dune-autopkgtest ||
        fail "E: Running the test program under MPI with ${mpi} ranks failed."
fi