]> andersk Git - libyaml.git/blob - tests/run-test-suite/test/libyaml-parser.t
c891df95e05086b6fbb05d716efafb323bd335e0
[libyaml.git] / tests / run-test-suite / test / libyaml-parser.t
1 #!/usr/bin/env bash
2
3 set -e
4
5 if [[ $# -gt 0 ]]; then
6   ids=("$@")
7 else
8   ids=(`find data | grep '/===$' | cut -d/ -f2 | sort`)
9 fi
10
11 count=0
12 for id in "${ids[@]}"; do
13   dir="data/$id"
14   label="$id: $(< $dir/===)"
15   [[ -e "$dir/in.yaml" ]] || continue
16   if grep "$id" test/libyaml-parser.skip >/dev/null; then
17     echo "ok $((++count)) # SKIP $label"
18     continue
19   fi
20   ./src/libyaml-parser "$dir/in.yaml" > /tmp/test.out || {
21     (
22       cat "$dir/in.yaml"
23       cat "$dir/test.event"
24     ) | sed 's/^/# /'
25   }
26   ok=true
27   output="$(${DIFF:-diff} -u $dir/test.event /tmp/test.out)" || ok=false
28   if $ok; then
29     echo "ok $((++count)) $label"
30   else
31     echo "not ok $((++count)) $label"
32     echo "$output" | sed 's/^/# /'
33   fi
34 done
35
36 echo "1..$count"
This page took 0.024121 seconds and 3 git commands to generate.