2016-04-27 17:13:36 +10:00
|
|
|
#!/bin/sh
|
|
|
|
|
2018-07-05 13:43:28 +10:00
|
|
|
validate="@CMAKE_CURRENT_BINARY_DIR@/json-validate"
|
2016-04-27 17:13:36 +10:00
|
|
|
|
|
|
|
count=0
|
|
|
|
code=0
|
|
|
|
|
2018-07-05 13:43:28 +10:00
|
|
|
for i in $(ls "@CMAKE_CURRENT_SOURCE_DIR@/test/json/good/"*);
|
2016-04-27 17:13:36 +10:00
|
|
|
do
|
2018-07-05 13:43:28 +10:00
|
|
|
$validate $i 2>/dev/null 1>&2
|
2016-04-27 17:13:36 +10:00
|
|
|
|
2018-07-05 13:43:28 +10:00
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
echo "ok - good/$(basename $i .json)"
|
|
|
|
else
|
|
|
|
echo "not ok - good/$(basename $i .json)"
|
|
|
|
code=1
|
|
|
|
fi
|
2016-04-27 17:13:36 +10:00
|
|
|
|
|
|
|
count=$((count+1))
|
|
|
|
done
|
|
|
|
|
2018-07-05 13:43:28 +10:00
|
|
|
for i in $(ls "@CMAKE_CURRENT_SOURCE_DIR@/test/json/bad/"*);
|
2016-04-27 17:13:36 +10:00
|
|
|
do
|
2018-07-05 13:43:28 +10:00
|
|
|
$validate $i 1>&2 2>/dev/null
|
|
|
|
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
echo "not ok - bad/$(basename $i .json)"
|
|
|
|
code=1
|
|
|
|
else
|
|
|
|
echo "ok - bad/$(basename $i .json)"
|
|
|
|
fi
|
2016-04-27 17:13:36 +10:00
|
|
|
|
|
|
|
count=$((count+1))
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "1..$count"
|
2018-07-05 13:43:28 +10:00
|
|
|
exit $code
|