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