summaryrefslogtreecommitdiff
path: root/src/test/libyaml-emitter.t
blob: 7afd5f067459c0fde8eedeacb84e554ac692435e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash

got=$(mktemp)

count=0
for test in test/*.events; do
  want=${test//.events/.out}
  label="Emitting '$test' equals '$want'"
  rc=0
  ./libyaml-emitter $test > $got || rc=$?
  if [[ $rc -ne 0 ]]; then
    echo "not ok $((++count)) - Error code $rc"
    continue
  fi
  rc=0
  diff=$(diff -u $want $got) || rc=$?
  if [[ $rc -eq 0 ]]; then
    echo "ok $((++count)) - $label"
  else
    echo "not ok $((++count)) - $label"
    diff=${diff//$'\n'/$'\n'# }
    echo "# $diff"
  fi
done

echo "1..$count"