]> andersk Git - libyaml.git/blame - 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
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
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
a672b071
IN
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
37done
38
39echo "1..$count"
This page took 0.064454 seconds and 5 git commands to generate.