chiark / gitweb /
test suite: enumerate-tests: Refactor dependencies, support NO-DEFAULT
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Jun 2018 15:18:20 +0000 (16:18 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Jun 2018 15:33:12 +0000 (16:33 +0100)
This will allow more flexibility in a moment.

No users of NO-DEFAULT yet, and no functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/tests/control.in
tests/enumerate-tests

index 960d3ef..b558a25 100644 (file)
@@ -1,2 +1,2 @@
 Tests-Directory: tests/tests
-Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin
+Depends: 
index 2c00f97..3ef0fe9 100755 (executable)
@@ -42,15 +42,26 @@ finish- () {
 
 test-begin-gencontrol () {
        restrictions=''
-       dependencies=''
+       dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin'
 }
 
 restriction-gencontrol () {
        restrictions+=" $r"
 }
 
+gencontrol-add-deps () {
+       for dep in "$@"; do
+               dependencies+="${dependencies:+, }$dep"
+       done
+}
+
 dependencies-gencontrol () {
-       dependencies+=", $deps"
+       for dep in "$deps"; do
+               case "$dep" in
+               NO-DEFAULT) dependencies='' ;;
+               *) gencontrol-add-deps "$dep" ;;
+               esac
+       done
 }
 
 test-done-gencontrol () {