]>
Commit | Line | Data |
---|---|---|
a672b071 IN |
1 | #!/usr/bin/env bash |
2 | ||
3 | set -e | |
4 | ||
5 | if [[ $# -gt 0 ]]; then | |
6 | ids=("$@") | |
7 | else | |
c9878e19 | 8 | ids=($(cut -d: -f1 < test/libyaml-emitter.list)) |
a672b071 IN |
9 | fi |
10 | ||
a672b071 IN |
11 | count=0 |
12 | for id in "${ids[@]}"; do | |
13 | dir="data/$id" | |
14 | label="$id: $(< $dir/===)" | |
15 | [[ -e "$dir/in.yaml" ]] || continue | |
a672b071 IN |
16 | want="$dir/out.yaml" |
17 | [[ -e $want ]] || want="$dir/in.yaml" | |
e5aadc73 | 18 | ../../tests/run-emitter-test-suite "$dir/test.event" > /tmp/test.out || { |
a672b071 IN |
19 | ( |
20 | cat "$dir/test.event" | |
21 | cat "$want" | |
22 | ) | sed 's/^/# /' | |
23 | } | |
24 | ok=true | |
25 | output="$(${DIFF:-diff} -u $want /tmp/test.out)" || ok=false | |
26 | if $ok; then | |
27 | echo "ok $((++count)) $label" | |
28 | else | |
29 | echo "not ok $((++count)) $label" | |
30 | echo "$output" | sed 's/^/# /' | |
31 | fi | |
32 | done | |
33 | ||
34 | echo "1..$count" |