3 t-tstunt-parsechangelog
5 t-prep-newpackage example 1.0
9 git checkout -b bad-build-deps indep-arch
10 perl -pe 's/Build-Depends.*/$&, x-dgit-no-such-package/' \
12 git commit -a -m bad-build-deps
14 cat <<'END' >$tmp/stunt-git
17 *clean*) echo >&2 "BUILD-MODES PROGRAM git $*" ;;
21 chmod +x $tmp/stunt-git
23 if zgrep 'dpkg-buildpackage: Make dependency checks fatal for -S' \
24 /usr/share/doc/dpkg-dev/changelog.gz; then
25 dpkgbuildpackage_deps_for_clean=true
27 dpkgbuildpackage_deps_for_clean=false
31 bm-guess-e-source-e-targets () {
34 *" -b") e_source=false; e_targets='build binary' ;;
35 *" -B") e_source=false; e_targets='build-arch binary-arch' ;;
36 *" -A") e_source=false; e_targets='build-indep binary-indep' ;;
37 *" -S") e_source=true; e_targets=' ' ;;
38 *" -F") e_source=true; e_targets='build binary' ;;
39 *) e_source=true; e_targets='build binary' ;;
46 echo >&4 "SOURCE EXISTS"
48 echo >&4 "SOURCE MISSING"
54 indep-arch) return 0 ;;
55 bad-build-deps) return 1 ;;
59 bm-compute-expected () {
60 require_fail=unexpect # or required
61 tolerate_fail=unexpect # or tolerate
67 git) echo >&4 'BUILD-MODES PROGRAM git clean -xdf' ;;
68 git-ff) echo >&4 'BUILD-MODES PROGRAM git clean -xdff' ;;
69 check) echo >&4 'BUILD-MODES PROGRAM git clean -xdn' ;;
70 dpkg-source-d) echo >&4 "EXAMPLE RULES TARGET clean" ;;
71 dpkg-source) bm-build-deps-ok || tolerate_fail=tolerate
72 echo >&4 "EXAMPLE RULES TARGET clean"
75 *) fail "t-compute-expected-run $cleanmode ??" ;;
78 if [ "x$e_targets" != x ]; then
79 # e_targets can be " " to mean `/may/ fail due to b-d'
80 bm-build-deps-ok || tolerate_fail=tolerate
83 for t in $e_targets; do
84 bm-build-deps-ok || require_fail=required
85 echo >&4 "EXAMPLE RULES TARGET $t"
88 bm-report-source $e_source
94 local args="--clean=$cleanmode $real_act"
96 bmid="$act,$cleanmode,$branch"
99 heading="===== [$bmid] dgit $args ====="
101 bmlog=$tmp/run.$bmid.output
102 bmexp=$tmp/run.$bmid.expected
103 bmgot=$tmp/run.$bmid.results
109 dsc='../example_1.0.dsc'
113 t-dgit --git=$tmp/stunt-git $args 2>&1 | tee $bmlog
114 local ps="${PIPESTATUS[*]}"
123 "0 0") actual_status=success ;;
124 *" 0") actual_status=failure; echo >&4 "OPERATION FAILED"; ;;
125 *) fail "tee failed" ;;
128 case "$require_fail-$tolerate_fail-$actual_status" in
129 required-********-failure) echo >>$bmexp "REQUIRED FAILURE" ;;
130 ********-tolerate-failure) echo >>$bmexp "TOLERATED FAILURE" ;;
131 unexpect-********-success) ;;
132 *) fail "RF=$require_fail TF=$tolerate_fail AS=$actual_status" ;;
135 egrep >&4 '^EXAMPLE RULES TARGET|^BUILD-MODES' $bmlog || [ $? = 1 ]
137 bm-report-source [ -e $dsc ]
141 $bm_quirk_before_diff
143 [ $actual_status = failure ] || diff -U10 $bmexp $bmgot
147 for cleanmode in git none dpkg-source dpkg-source-d; do
148 # git-ff check removed because they're really very similar
149 for branch in indep-arch bad-build-deps; do
153 : bm-act-iterate done.