]> andersk Git - libyaml.git/blame - tests/run-test-suite/test/libyaml-emitter.t
Replace Mercurial with Git in README
[libyaml.git] / tests / run-test-suite / test / libyaml-emitter.t
CommitLineData
a672b071
IN
1#!/usr/bin/env bash
2
3set -e
4
5if [[ $# -gt 0 ]]; then
6 ids=("$@")
7else
c9878e19 8 ids=($(cut -d: -f1 < test/libyaml-emitter.list))
a672b071
IN
9fi
10
a672b071
IN
11count=0
12for 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
32done
33
34echo "1..$count"
This page took 0.046785 seconds and 5 git commands to generate.