test_all.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 mydir=$(dirname $(readlink -f $BASH_SOURCE))
4 pgdir=$(dirname $mydir)
5 cfgdir=$(dirname $pgdir)
6 
7 errors=""
8 for jsfile in $mydir/test*.jsonnet
9 do
10  dat="$(jsonnet -J $cfgdir $jsfile 2>/dev/null)"
11  if [ -z "$dat" -o "$?" != "0" ] ; then
12  errors="$jsfile $errors"
13  fi
14 done
15 
16 if [ -n "$errors" ] ; then
17  echo "Failed tests:"
18  for one in $errors; do
19  echo -e "\t$one"
20  done
21  exit 1
22 fi