diff options
author | Ingy döt Net <ingy@ingy.net> | 2020-05-25 21:42:19 -0700 |
---|---|---|
committer | Ingy döt Net <ingy@ingy.net> | 2020-05-25 22:24:14 -0700 |
commit | f2d7db65e551b4231b6bc4c1ac80d9ffaa638ea6 (patch) | |
tree | dbaab114adc8f188908b2b10a5707fb20860d0c5 /test/test-runner.bash | |
download | libyaml-git-testing.tar.gz |
Initial committesting
Diffstat (limited to 'test/test-runner.bash')
-rw-r--r-- | test/test-runner.bash | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/test-runner.bash b/test/test-runner.bash new file mode 100644 index 0000000..8360308 --- /dev/null +++ b/test/test-runner.bash @@ -0,0 +1,35 @@ +# shellcheck disable=2001,2154,2207 + +set -e -u -o pipefail + +run-tests() ( + root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) + + cd "$root" + + if [[ $# -gt 0 ]]; then + ids=("$@") + else + ids=($(cd data; printf "%s\n" * | grep '[0-9]')) + fi + + count=0 + for id in "${ids[@]}"; do + check-test "$id" || continue + + dir=data/$id + label="$id: $(< "$dir/===")" + [[ -e $dir/in.yaml ]] || continue + + run-test "$dir" + + if $ok; then + echo "ok $((++count)) $label" + else + echo "not ok $((++count)) $label" + echo "$output" | sed 's/^/# /' + fi + done + + echo "1..$count" +) |