16 whynot=$(t-restriction-$r)
23 1.?*) whynots="$whynots${whynots:+; }$whynot" ;;
24 *) fail "restriction $r for $t gave $rc $whynot !"
35 ?*) echo >&2 "SKIP $t $whynots" ;;
43 test-begin-gencontrol () {
45 dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime'
48 gencontrol-add-things () {
49 local varname=$1; shift
54 case " $'$varname$delim '" in
55 *" "$thing"'$delim' "*) continue ;;
57 '$varname'+="${'$varname':+'$delim' }$thing"
62 restriction-gencontrol () {
63 if [ $r = x-dgit-out-of-tree-only ]; then return; fi
64 gencontrol-add-things restrictions '' "$r"
67 gencontrol-add-deps () {
68 gencontrol-add-things dependencies , "$@"
71 dependencies-gencontrol () {
72 for dep in "$deps"; do
74 NO-DGIT) dependencies='chiark-utils-bin, faketime' ;;
75 NO-DEFAULT) dependencies='' ;;
76 GDR) gencontrol-add-deps \
77 git-debrebase git-buildpackage
79 DEBORIG) gencontrol-add-deps \
80 devscripts libdpkg-perl \
81 libgit-wrapper-perl liblist-compare-perl \
82 libstring-shellquote-perl libtry-tiny-perl \
83 # NB git-deborig is not compatible with
84 # t-tstunt-parsechangelog
86 *) gencontrol-add-deps "$dep" ;;
91 test-done-gencontrol () {
93 add_Depends="$dependencies" \
94 perl <debian/tests/control.in -wpe '
97 s{$}{ $ENV{"add_$h"} // "" }e;
100 case "$restrictions" in
101 ?*) echo "Restrictions: $restrictions" ;;
104 key=$(printf "%s" "$stanza" | sha256sum)
107 stanza_$key=\"\$stanza\"
108 tests_$key+=\" \${t#tests/tests/}\"
110 keys=" ${keys/ $key /}"
114 finish-gencontrol () {
120 printf "Tests:%s\n%s\n\n" "$tests" "$stanza"
128 /^: t-enumerate-tests-end$/q;
135 for r in $(seddery 's/^t-restrict //p'); do
138 for deps in $(seddery 's/^t-dependencies //p'); do
141 for import in $(seddery 's/^t-setup-import //p'); do
142 allsedderies tests/setup/$import
146 for t in $(run-parts --list tests/tests); do