chiark / gitweb /
test suite: sbuild-gitish: Find sbuild rune in the manpage
[dgit.git] / tests / tests / sbuild-gitish
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-dependencies sbuild man-db
6 t-restrict x-dgit-schroot-build
7
8 t-tstunt-parsechangelog
9
10 t-prep-newpackage example 1.1
11
12 buildrune=$(
13         (export LC_ALL=C.UTF-8
14          if [ "$DGIT_TEST_INTREE" ]; then
15                 make -C $DGIT_TEST_INTREE dgit-user.7.view
16          else
17                 man 7 dgit-user
18          fi) | \
19         perl -ne '
20                 next unless m/^ +Using sbuild$/ .. 0;
21                 next unless m/^ +\%/ .. 0;
22                 next if !m/\S/ .. 0;
23                 s/^ +\%//;
24                 print or die $!;
25         '
26 )
27
28 cd $p
29
30 build () {
31         eval "$buildrune"
32 }
33
34 git checkout quilt-tip-1.1~0
35
36 build
37
38 git checkout gitish-only~0
39
40 cat <<'END' >clean-target-hook
41 #!/bin/sh
42 set -ex
43 test "$SCHROOT_SESSION_ID"
44 END
45 git add clean-target-hook
46 git commit -m 'insist on schroot'
47
48 build
49
50 t-ok