chiark / gitweb /
changelog: start 9.14
[dgit.git] / tests / enumerate-tests
index 3406e1cce38426244a45364450c2ab713ce29b11..9b9271cb1baf1cf756caed9313ba694e3a1d29a3 100755 (executable)
@@ -42,21 +42,30 @@ finish- () {
 
 test-begin-gencontrol () {
        restrictions=''
-       dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime'
+       dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, liburi-perl'
+}
+
+gencontrol-add-things () {
+       local varname=$1; shift
+       local delim=$1; shift
+       local thing
+       eval '
+               for thing in "$@"; do
+                       case " $'$varname$delim '" in
+                       *" "$thing"'$delim' "*) continue ;;
+                       esac
+                       '$varname'+="${'$varname':+'$delim' }$thing"
+               done
+       '
 }
 
 restriction-gencontrol () {
        if [ $r = x-dgit-out-of-tree-only ]; then return; fi
-       restrictions+=" $r"
+       gencontrol-add-things restrictions '' "$r"
 }
 
 gencontrol-add-deps () {
-       for dep in "$@"; do
-               case " $dependencies," in
-               *" "$dep","*)   continue ;;
-               esac
-               dependencies+="${dependencies:+, }$dep"
-       done
+       gencontrol-add-things dependencies , "$@"
 }
 
 dependencies-gencontrol () {
@@ -89,7 +98,7 @@ test-done-gencontrol () {
                        }
                ' 
                case "$restrictions" in
-               ?*) echo "Restrictions:$restrictions" ;;
+               ?*) echo "Restrictions: $restrictions" ;;
                esac
                )
        key=$(printf "%s" "$stanza" | sha256sum)
@@ -129,6 +138,13 @@ allsedderies () {
        for deps in $(seddery 's/^t-dependencies //p'); do
                dependencies-$mode
        done
+       for import in $(seddery 's/^t-setup-import //p'); do
+               allsedderies tests/setup/$import
+       done
+       if egrep -q '^t-alt-test *$' <$tf; then
+               local leaf=${tf#tests/tests/}
+               allsedderies tests/tests/"${leaf#*-}"
+       fi
 }
 
 for t in $(run-parts --list tests/tests); do