summaryrefslogtreecommitdiff
path: root/test/libyaml-parser-error.t
blob: a51578e362f8075aed56c3d19ef6e1dcdc4916c0 (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
27
28
#!/usr/bin/env bash

# shellcheck disable=1090,2034

root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)

source "$root"/test/test-runner.bash

check-test() {
  id=$1
  t=data/$id

  grep "$id" "$root/blacklist/libyaml-parser-error" >/dev/null && return 1
  [[ -e $t/error ]] || return 1

  return 0
}

run-test() {
  dir=$1
  ok=false

  libyaml/tests/run-parser-test-suite "$dir/in.yaml" > /tmp/test.out 2>&1 || ok=true

  $ok || output=$(< /tmp/test.out)
}

run-tests "$@"