File: test_subst_multiarch.bats

package info (click to toggle)
dh-exec 0.31
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 324 kB
  • sloc: ansic: 530; perl: 178; makefile: 126; sh: 67
file content (36 lines) | stat: -rwxr-xr-x 816 bytes parent folder | download | duplicates (9)
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
## -*- shell-script -*-

load "test.lib"

setup () {
        DEB_HOST_ARCH_BITS=128

        export DEB_HOST_ARCH_BITS
}

run_dh_exec_subst () {
        run_dh_exec src/dh-exec-subst <<EOF
DEB_HOST_MULTIARCH = \${DEB_HOST_MULTIARCH}
DEB_HOST_ARCH_BITS = \${DEB_HOST_ARCH_BITS}
EOF
}

@test "subst-multiarch: multi-arch variable is set" {
        run_dh_exec_subst

        expect_output "DEB_HOST_MULTIARCH = $(dpkg-architecture -qDEB_HOST_MULTIARCH)"
}

@test "subst-multiarch: ARCH_BITS uses environment variable" {
        run_dh_exec_subst

        expect_output "DEB_HOST_ARCH_BITS = 128"
}

@test "subst-multiarch: ARCH_BITS falls back to dpkg-architecture" {
        unset DEB_HOST_ARCH_BITS

        run_dh_exec_subst

        expect_output "DEB_HOST_ARCH_BITS = $(dpkg-architecture -qDEB_HOST_ARCH_BITS)"
}