diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-25 18:17:55 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-25 18:32:29 +0100 |
commit | 493c7cbb41990703f365d809f1af5a0555b919f7 (patch) | |
tree | 664d75df812d6b52b0c67582f757df1ad6ce1595 | |
parent | ada48ca013e77d7e821d326db40bc1a59ba639ea (diff) |
Test suite: Implement list-tests gencontrol
-rw-r--r-- | debian/tests/control.in | 2 | ||||
-rwxr-xr-x | tests/list-tests | 41 |
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 |