aboutsummaryrefslogtreecommitdiff
path: root/test_pbuilder-satisfydepends-funcs
blob: 26bf94ce60e71f8abc616e42d84c5e4a5b5b7fb9 (plain)
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
#!/bin/bash

. ./testlib.sh
. ./pbuilder-satisfydepends-funcs

# testsuite to test pbuilder-satisfydepends-funcs.

DEBIAN_CONTROL=""

cleanup() {
    if [ -n "$DEBIAN_CONTROL" ]; then
        rm -f "$DEBIAN_CONTROL"
    fi
}

test_get_control_re() {
    cat <<EOF >"$DEBIAN_CONTROL"
Source: amule
XXXX:
Build-Depends: 
 autotools-dev,
 debhelper,
 quilt,
##
 libwxgtk2.8-dev
Build-Depends-Indep: test, test1, 
 test2, test3 | 
 test4, test5
Misc: test

Build-Depends: wrong build depends, line
Description: test
 other things
 wow
EOF
    get_control_re "$DEBIAN_CONTROL" "build-(depends|depends-indep)"
}

trap cleanup sigpipe sighup exit

# TODO move to build dir
DEBIAN_CONTROL="$(tempfile)"

expect_output "  autotools-dev, debhelper, quilt, libwxgtk2.8-dev
 test, test1,  test2, test3 |  test4, test5" test_get_control_re

testlib_summary