summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-25 19:02:50 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-25 19:02:50 +0100
commit998585898243fcead22928f903331412091936cb (patch)
treecb4cc37311e51d2ec606b53fde51907852c45e26 /tests
parentf8b5f0c45e4b6b8c90cf6097d7d7d11a55852510 (diff)
Test suite: Support t-dependencies (for gencontrol, not for tests/run-all)
Diffstat (limited to 'tests')
-rw-r--r--tests/lib4
-rwxr-xr-xtests/list-tests20
2 files changed, 23 insertions, 1 deletions
diff --git a/tests/lib b/tests/lib
index d131e7b..ef2a8d5 100644
--- a/tests/lib
+++ b/tests/lib
@@ -602,6 +602,10 @@ t-restrict () {
(cd $root; t-restriction-$restriction >&2)
}
+t-dependencies () {
+ : "Hopefully installed: $*"
+}
+
t-chain-test () {
local ct=$1
local d=${0%/*}
diff --git a/tests/list-tests b/tests/list-tests
index 3381dbf..8578fe6 100755
--- a/tests/list-tests
+++ b/tests/list-tests
@@ -23,6 +23,10 @@ restriction- () {
esac
}
+dependencies- () {
+ :
+}
+
test-done- () {
case "$whynots" in
'') echo $t ;;
@@ -36,15 +40,26 @@ finish- () {
test-begin-gencontrol () {
restrictions=''
+ dependencies=''
}
restriction-gencontrol () {
restrictions+=" $r"
}
+dependencies-gencontrol () {
+ dependencies+=", $deps"
+}
+
test-done-gencontrol () {
stanza=$(
- sed <debian/tests/control.in ''
+ add_Depends="$dependencies" \
+ perl <debian/tests/control.in -wpe '
+ if (/^(\w+):/) {
+ my $h = $1;
+ s{$}{ $ENV{"add_$h"} // "" }e;
+ }
+ '
case "$restrictions" in
?*) echo "Restrictions:$restrictions" ;;
esac
@@ -83,6 +98,9 @@ for t in $(run-parts --list tests/tests); do
for r in $(seddery 's/^t-restrict //p'); do
restriction-$mode
done
+ for deps in $(seddery 's/^t-dependencies //p'); do
+ dependencies-$mode
+ done
test-done-$mode
done