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