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