diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-25 17:36:18 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-25 18:32:29 +0100 |
commit | ada48ca013e77d7e821d326db40bc1a59ba639ea (patch) | |
tree | 795d0bcac6795fcf7168e1e60a88186ddba383f4 /tests/list-tests | |
parent | 417bcf4ea06b9e181c39734e121d9a32cf7cbb21 (diff) |
Test suite: Introduce tests/list-tests
Diffstat (limited to 'tests/list-tests')
-rwxr-xr-x | tests/list-tests | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/list-tests b/tests/list-tests new file mode 100755 index 0000000..21f96b4 --- /dev/null +++ b/tests/list-tests @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e + +. tests/lib-core +. tests/lib-restricts + +mode=$1 + +test-begin- () { + whynots='' +} + +restriction- () { + set +e + whynot=$(t-restriction-$r) + rc=$? + set -e + case "$rc.$whynot" in + 0.) ;; + 1.?*) whynots="$whynots${whynots:+; }$whynot" ;; + *) fail "restriction $r for $t gave $rc $whynot !" + esac +} + +test-done- () { + case "$whynots" in + '') echo $t ;; + ?*) echo >&2 "SKIP $t $whynots" ;; + esac +} + +for t in $(run-parts --list tests/tests); do + test-begin-$mode + for r in $(sed <$t -n ' + 20q; + /^: t-list-tests-end$/q; + s/^t-restrict //p + '); do + restriction-$mode + done + test-done-$mode +done |