]> andersk Git - libyaml.git/blame - tests/run-test-suite/test/libyaml-emitter.t
Skip edge case test M7A3
[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
8 ids=(`find data | grep '/===$' | cut -d/ -f2 | sort`)
9fi
10
11# Some environments like on OS X, the shell resets the following vars, so we
12# work around it like so:
13export LD_LIBRARY_PATH="${MY_LD_LIBRARY_PATH:?}"
14export DYLD_LIBRARY_PATH="${MY_LD_LIBRARY_PATH:?}"
15
16count=0
17for id in "${ids[@]}"; do
18 dir="data/$id"
19 label="$id: $(< $dir/===)"
20 [[ -e "$dir/in.yaml" ]] || continue
21 if grep "$id" test/libyaml-emitter.skip >/dev/null; then
22 echo "ok $((++count)) # SKIP $label"
23 continue
24 fi
25 want="$dir/out.yaml"
26 [[ -e $want ]] || want="$dir/in.yaml"
27 ./src/libyaml-emitter "$dir/test.event" > /tmp/test.out || {
28 (
29 cat "$dir/test.event"
30 cat "$want"
31 ) | sed 's/^/# /'
32 }
33 ok=true
34 output="$(${DIFF:-diff} -u $want /tmp/test.out)" || ok=false
35 if $ok; then
36 echo "ok $((++count)) $label"
37 else
38 echo "not ok $((++count)) $label"
39 echo "$output" | sed 's/^/# /'
40 fi
41done
42
43echo "1..$count"
This page took 0.856972 seconds and 5 git commands to generate.