libcruft-util/test/json.test.in

28 lines
549 B
Plaintext
Raw Normal View History

#!/bin/sh
2014-05-26 17:34:23 +10:00
validate=@abs_top_builddir@/tools/json-validate
2014-05-26 17:34:23 +10:00
good=(@abs_top_srcdir@/test/json/good/*)
bad=(@abs_top_srcdir@/test/json/bad/*)
count=$((${#good[@]}+${#bad[@]}))
echo 1..$count
for i in ${good[@]};
do
$validate $i 2>/dev/null 1>&2
case $? in
0) echo "ok - $(basename $i .json)";;
*) echo "not ok - $(basename $i .json)";;
esac
done
for i in ${bad[@]};
do
$validate $i 1>&2 2>/dev/null
case $? in
0) echo "not ok - $(basename $i .json)";;
*) echo "ok - $(basename $i .json)";;
esac
done