aboutsummaryrefslogtreecommitdiff
path: root/t/test_pbuilder-checkparams
blob: a81ae8d527eb6050e38e30c4c0b168c6b9fc0691 (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
#!/bin/bash

# testsuite for pbuilder-checkparams

TD="$(dirname "$0")"
if [ -n "$PBUILDER_CHECKOUT" ]; then
    . "$TD/testlib.sh"
    PBUILDER_CHECKPARAMS="$PBUILDER_CHECKOUT/pbuilder-checkparams"
else
    . "$TD/testlib.sh"
    PBUILDER_CHECKPARAMS="$PBUILDER_TEST_PKGLIBDIR/pbuilder-checkparams"
fi

# setup a fake installed environment
trap testlib_cleanup_env sigpipe sighup exit
testlib_setup_env

test_debuildopts() {
    . "$PBUILDER_CHECKPARAMS"
    echo "$DEBBUILDOPTS"
}

expect_output "" \
    test_debuildopts foo.dsc
expect_output "" \
    test_debuildopts --debbuildopts "" foo.dsc
expect_output "-v1.0 -efoo" \
    test_debuildopts --debbuildopts "-v1.0 -efoo" foo.dsc
expect_output "-v1.0 -efoo" \
    test_debuildopts --debbuildopts -v1.0 --debbuildopts -efoo foo.dsc
expect_output "-efoo" \
    test_debuildopts --debbuildopts -v1.0 --debbuildopts "" --debbuildopts -efoo foo.dsc

testlib_summary