]> andersk Git - libyaml.git/blob - tests/run-test-suite/test/libyaml-emitter.t
Replace Mercurial with Git in README
[libyaml.git] / tests / run-test-suite / test / libyaml-emitter.t
1 #!/usr/bin/env bash
2
3 set -e
4
5 if [[ $# -gt 0 ]]; then
6   ids=("$@")
7 else
8   ids=($(cut -d: -f1 < test/libyaml-emitter.list))
9 fi
10
11 count=0
12 for id in "${ids[@]}"; do
13   dir="data/$id"
14   label="$id: $(< $dir/===)"
15   [[ -e "$dir/in.yaml" ]] || continue
16   want="$dir/out.yaml"
17   [[ -e $want ]] || want="$dir/in.yaml"
18   ../../tests/run-emitter-test-suite "$dir/test.event" > /tmp/test.out || {
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"
This page took 0.03425 seconds and 5 git commands to generate.