summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/tests/control.in2
-rwxr-xr-xtests/list-tests41
2 files changed, 43 insertions, 0 deletions
diff --git a/debian/tests/control.in b/debian/tests/control.in
new file mode 100644
index 0000000..62ff3ee
--- /dev/null
+++ b/debian/tests/control.in
@@ -0,0 +1,2 @@
+Tests-Directory: tests/tests
+Depends: dgit, dgit-infrastructure, devscripts, rsync
diff --git a/tests/list-tests b/tests/list-tests
index 21f96b4..d0582f6 100755
--- a/tests/list-tests
+++ b/tests/list-tests
@@ -30,6 +30,45 @@ test-done- () {
esac
}
+finish- () {
+ :
+}
+
+test-begin-gencontrol () {
+ restrictions=''
+}
+
+restriction-gencontrol () {
+ restrictions+=" $r"
+}
+
+test-done-gencontrol () {
+ stanza=$(
+ sed <debian/tests/control.in ''
+ case "$restrictions" in
+ ?*) echo "Restrictions:$restrictions" ;;
+ esac
+ )
+ key=$(printf "%s" "$stanza" | sha256sum)
+ key=${key%% *}
+ eval "
+ stanza_$key=\"\$stanza\"
+ tests_$key+=\" \${t#tests/tests/}\"
+ "
+ keys=" ${keys/ $key /}"
+ keys+=" $key "
+}
+
+finish-gencontrol () {
+ for key in $keys; do
+ eval "
+ stanza=\$stanza_$key
+ tests=\$tests_$key
+ "
+ printf "Tests:%s\n%s\n\n" "$tests" "$stanza"
+ done
+}
+
for t in $(run-parts --list tests/tests); do
test-begin-$mode
for r in $(sed <$t -n '
@@ -41,3 +80,5 @@ for t in $(run-parts --list tests/tests); do
done
test-done-$mode
done
+
+finish-$mode