#!/bin/bash set -e . tests/lib-core . tests/lib-restricts mode=$1 test-begin- () { whynots='' } restriction- () { set +e whynot=$(t-restriction-$r) rc=$? whynot="${whynot// / / }" set -e case "$rc.$whynot" in 0.) ;; 1.?*) whynots="$whynots${whynots:+; }$whynot" ;; *) fail "restriction $r for $t gave $rc $whynot !" esac } dependencies- () { : } test-done- () { case "$whynots" in '') echo $t ;; ?*) echo >&2 "SKIP $t $whynots" ;; esac } finish- () { : } test-begin-gencontrol () { restrictions='' dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime' } restriction-gencontrol () { if [ $r = x-dgit-out-of-tree-only ]; then return; fi restrictions+=" $r" } gencontrol-add-deps () { for dep in "$@"; do case " $dependencies," in *" "$dep","*) continue ;; esac dependencies+="${dependencies:+, }$dep" done } dependencies-gencontrol () { for dep in "$deps"; do case "$dep" in NO-DGIT) dependencies='chiark-utils-bin, faketime' ;; NO-DEFAULT) dependencies='' ;; GDR) gencontrol-add-deps \ git-debrebase git-buildpackage ;; DEBORIG) gencontrol-add-deps \ devscripts libdpkg-perl \ libgit-wrapper-perl liblist-compare-perl \ libstring-shellquote-perl libtry-tiny-perl \ # NB git-deborig is not compatible with # t-tstunt-parsechangelog ;; *) gencontrol-add-deps "$dep" ;; esac done } test-done-gencontrol () { stanza=$( add_Depends="$dependencies" \ perl